I have a WCF service used by a .net application. Due to some library issues I have to change .net application in to PHP language. Rather
than creating a new web service, there is a simple way of accessing WCF using PHP.
But there are few concerns. You cannot use WSHttpBinding with PHP. I have to
change my bindings in to basicHttpBinding because PHP soap protocols are notsupporting wshttpbindings.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$client = new SoapClient('http://188.188.188.188:8980/CalService/Service/?wsdl'); | |
$params = new StdClass; | |
$params->value = 2; | |
$retval = $client->GetData($params); | |
echo $retval-> GetDataResult; | |
?> | |
// In echo $retval you need to mention your method name first and then Result. | |
//My service method | |
[OperationContract] | |
string GetData(int value); | |
// endpoint | |
<endpoint address="" binding="basicHttpBinding" contract=" ICalService"> |