Search code examples
.netphpwcfnettcpbinding

Connecting to a WCF Service in PHP that has a a NetTCP Binding and a BasicHttpBinding


I have a WCF service. It has multiple clients and three endpoints. The endpoint bindings are nettcp, wsHttp and basicHttp. If I attempt to connect to it via php'd builtin SoapClient class like so:

$service = new SoapClient
("http://service.companyname.local:6666/Service/?wsdl",
 array(
         "location" => "http://service.companyname.local:6666/Service/Basic",

    "trace" => true,
    'soap_version' => SOAP_1_1
     )
);

I get the following:

PHP Fatal error:  SOAP-ERROR: Parsing WSDL: PHP-SOAP doesn't support transport 'http://schemas.microsoft.com/soap/tcp' in c:\www\client.php on line 666

Right now my workaround is to save the wsdl manually and remove the nettcp binding. Is there a workaround that will allow me to use the automatically generated wsdl? Can I hide a binding from the wsdl in web.config? Can I generate different wsdls on different bindings. I don't want to deploy two service hosts.


Solution

  • I filed a feature request with PHP. If they implement this I'll mark this as the correct answer. I'm still open to better workarounds though.

    UPDATE: I submitted a patch to implement this. I am awaiting its approval.
    UPDATE: Patch committed to svn. Awaiting the next release of PHP.
    UPDATE: Patch is now part of PHP 5.3.3 and 5.2.14.