NuSOAP: how to change content-type of request?

jao picture jao · Jun 3, 2009 · Viewed 41.6k times · Source

When consuming a .NET WCF webservice I get the following response (error):

Unsupported HTTP response status 415 Cannot process the message because the content type 'text/xml; charset=UTF-8' was not the expected type 'application/soap+xml; charset=utf-8'.

How do I change the content type? I can't find it in the NuSOAP forums/docs, or I might be overlooking something....

Answer

mark moore picture mark moore · Nov 6, 2009

i know this is an old post, but i ran in to this page looking for an answer.

application/soap+xml is the content-type passed when using SOAP 1.2, text/xml is used with SOAP 1.1,

something like this should do the trick,

$client = new SoapClient("some.wsdl", array('soap_version' => SOAP_1_1));