I am using the PHP SoapServer class and trying to put plain XML in the body of a SOAP response.
Case 1:
My WSDL has
<element name="getDataResponse" type="xsd:string"/>
I encode the answer
return new SoapVar($my_xml,XSD_ANYXML)
PHP SoapClient says
SOAP-ERROR: Encoding: Violation of encoding rules
Case 2:
Wsdl
<element name="getDataResponse" type="xsd:string"/>
response
return new SoapVar($my_xml,XSD_STRING)
the XML response has everything <encoded as <and> as>
Case 3:
Wdsl
<element name="getDataResponse">
<complexType>
...
</complexType>
</element>
where complexType matches the XML structure to return
response
return new SoapVar($my_xml,XSD_ANYXML)
now the return type is an object, not an XML string
Case 4
the same as in case 3, except for the encoding as SOAP_ENC_OBJECT. Again the result will be an object.
Please, help! How can I get plain XML text as the body of a SOAP response?
source
share