I created a WCF service, I have two endpoints one for wsHttpBinding and one for basicHttpBinding. I am able to consume the wsHttpBinding and basicHttpBinding, just fine with ASP.Net call.
I am having problems trying to consume the basicHttpBinding service with php.
Here is the metadata.
<wsdl:definitions name="PURLService" targetNamespace="http://xxx.xxx.com/TMServices/">
<wsdl:import namespace="http://tempuri.org/" location="http://xxx.xxx.com/TMServices/PURLServ.svc?wsdl=wsdl1"/>
<wsdl:types/>
<wsdl:service name="PURLService">
<wsdl:port name="WSHttpBinding_ITMService" binding="i0:WSHttpBinding_ITMService">
<soap12:address location="http://xxx.xxx.com/TMServices/PURLServ.svc/ws"/>
<wsa10:EndpointReference>
<wsa10:Address>http://xxx.xxx.com/TMServices/PURLServ.svc/ws</wsa10:Address>
<Identity>
<Spn>host/xxx.xxx.com</Spn>
</Identity>
</wsa10:EndpointReference>
</wsdl:port>
<wsdl:port name="BasicHttpBinding_ITMService" binding="i0:BasicHttpBinding_ITMService">
<soap:address location="http://xxx.xxx.com/TMServices/PURLServ.svc/basic"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
when I try to call the basicHttpBinding endpoint by giving the address http://xxx.xxx.com/TMServices/PURLServ.svc/basic on php I get the following error "SOAP-ERROR: Parsing WSDL: Couldn't load from 'http://xxx.xxx.com/TMServices/PURLServ.svc/basic' : failed to load external entity "
this is the php code:
$wsdl = "http://xxx.xxx.com/TMServices/PURLServ.svc/basic";
try {
$client = new SoapClient($wsdl);
$result = $client->TestServices(); //this should return true if accessed
print $result;
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
?>
Also I am not able to access http://xxx.xxx.com/TMServices/PURLServ.svc/basic directly I get a 400 Bad Request error.
when I try with http://xxx.xxx.com/TMServices/PURLServ.svc?wsdl address on the php code I get the following error: "Cannot process the message because the content type 'text/xml; charset=utf-8' was not the expected type 'application/soap+xml; charset=utf-8'. "
I appreciate any help.