I've created a .NET WCF service that is intended to always be over HTTPS. When I first created the service skeleton and ran it over HTTP, it worked fine. I used PHP5 to test the interoperability with the built in SOAP functions. However, once I switched to HTTPS, when I try to call the function from PHP, I get a fault back with the message "Method Not Allowed" and the fault code of "http." It does allow me to retrieve the list of methods though. The error occurs when it calls the method "Test."
Here is the WCF configuration:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="secureBasic">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="apiBehavior" name="TestAPI.API">
<endpoint address="https://192.168.0.3/API"
binding="basicHttpBinding"
bindingConfiguration="secureBasic"
contract="TestAPI.IAPI"/>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="apiBehavior">
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
And here is how PHP is calling it:
$client = new SoapClient("https://192.168.0.3/API.svc?wsdl");
echo "<pre>" . print_r($client->__getFunctions(), 1) . "</pre>";
$param = new stdClass();
$param->A = "123";
$param->B = "456";
try {
$client->Test($param);
} catch (Exception $e) {
die("<pre>" . print_r($e,1) . "</pre>");
}
I'm using a self-signed SSL certificate for testing and I don't believe PHP requires a trusted certificate.
What am I doing wrong?