Search code examples
wsdlservicestack

Using Servicestack WSDL with php


I am trying to use ServiceStack to replace WCF for a self hosted service, accessed with a PHP client that forms its messages from on the WSDL.

The WSDL produced by ServiceStack has "part names" called "par" eg:

<wsdl:message name="GetServiceDetailsIn">   
    <wsdl:part name="par" element="tns:GetServiceDetails" />    
</wsdl:message>

Then the SOAP request produced by PHP looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body><par/></SOAP-ENV:Body>
</SOAP-ENV:Envelope>

instead of this from the built-in help:

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body> 
        <GetServiceDetails xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="urn:Shout" />
    </soap:Body>
</soap:Envelope>

The PHP client has used a par tag instead of GetServiceDetails and it gets a blank response. Can the "part name" definition can be renamed or removed in ServiceStack?


Solution

  • It seems you can't doing anything about this in ServiceStack and its not designed to work with PHP anyway. However you can get it working if you get PHP to tweak the XML tags with find-and-replace, or XSLTs, before sending it.