Note that there are some explanatory texts on larger screens.

plurals
  1. POPhp soap service evenlope <return> element
    primarykey
    data
    text
    <p>I am trying to build a web service to a specification of a 3rd party who will be connecting to it as a client, the service must be written in PHP but I am a total PHP n00b so struggling a little. Basically my responses are being wrapped in a element however the client is not accepting my responses because of this, here is an example.</p> <p>service.php</p> <pre><code>&lt;?php class MyService { public function Ping() { return date('d/m/Y H:i:s'); } } $server = new SoapServer(null, array( 'soap_version' =&gt; SOAP_1_2, 'encoding' =&gt; 'UTF-8', 'uri' =&gt; 'http://tempuri.org/')); $server-&gt;setClass("MyService"); $server-&gt;handle(); ?&gt; </code></pre> <p>Request</p> <pre><code>&lt;soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"&gt; &lt;soapenv:Header/&gt; &lt;soapenv:Body&gt; &lt;tem:Ping /&gt; &lt;/soapenv:Body&gt; &lt;/soapenv:Envelope&gt; </code></pre> <p>Response</p> <pre><code>&lt;SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"&gt; &lt;SOAP-ENV:Body&gt; &lt;ns1:PingResponse&gt; &lt;return xsi:type="xsd:string"&gt;18/11/2010 18:51:02&lt;/return&gt; &lt;/ns1:PingResponse&gt; &lt;/SOAP-ENV:Body&gt; &lt;/SOAP-ENV:Envelope&gt; </code></pre> <p>What the client is expecting is the PingResponse to just contain the date but without the wrapped around the outside. How can I get the PHP SoapClient to do this?</p> <p>E.g.</p> <pre><code>&lt;ns1:PingResponse&gt;18/11/2010 18:51:02&lt;/ns1:PingResponse&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload