Skip to content

Instantly share code, notes, and snippets.

@tahaipek
Last active June 7, 2018 17:05
Show Gist options
  • Save tahaipek/c575733f6efc2a7485fc to your computer and use it in GitHub Desktop.
Save tahaipek/c575733f6efc2a7485fc to your computer and use it in GitHub Desktop.
PHP, WCF Soap 1.2
#PHP Code
<?php
$wsdl = "http://localhost/WCF.Integration.Services/ITestService.svc?wsdl";
$url=$wsdl;
$svc = 'ITestService';
$func = 'TestMethod';
$client = new SoapClient($url, array('soap_version' => SOAP_1_2,
'encoding'=>'ISO-8859-1',
'exceptions' => true,
'trace' => true,
'connection_timeout' => 120));
$actionHeader[] = new SoapHeader('http://www.w3.org/2005/08/addressing',
'Action',
'http://tempuri.org/I'.$svc.'/'.$func,
true);
try
{
$client->__setSoapHeaders($actionHeader);
$info = $client->__soapCall($func, array('parameters' => array('methodParameter' => "Test")));
var_dump($info);
}
catch (SoapFault $fault)
{
var_dump($fault);
$xml=$fault->faultstring;
die;
}
?>
#WCF Configuration, Binding & EndPoint
<wsHttpBinding>
<binding name="wcfWsHttpBinding" maxReceivedMessageSize="104857600" maxBufferPoolSize="52428800" >
<readerQuotas maxArrayLength="104857600" maxBytesPerRead="104857600" maxDepth="104857600" maxStringContentLength="52400000" />
<security mode="None" />
</binding>
</wsHttpBinding>
<endpoint binding="wsHttpBinding" bindingConfiguration="wcfWsHttpBinding" contract="WCF.Integration.ITestService" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment