NuSOAP:如何更改请求的内容类型? [英] NuSOAP: how to change content-type of request?
问题描述
使用.NET WCF Web服务时,我得到以下响应(错误):
When consuming a .NET WCF webservice I get the following response (error):
不支持的HTTP响应状态415 由于内容类型为'text/xml ;,因此无法处理该消息; charset = UTF-8' 不是预期的类型'application/soap + xml; charset = utf-8'.
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'.
如何更改内容类型?我在NuSOAP论坛/文档中找不到它,或者我可能忽略了某些东西....
How do I change the content type? I can't find it in the NuSOAP forums/docs, or I might be overlooking something....
推荐答案
我知道这是一篇旧文章,但是我跑到了该页面中寻找答案.
i know this is an old post, but i ran in to this page looking for an answer.
application/soap+xml
是使用SOAP 1.2时传递的内容类型,
text/xml
与SOAP 1.1一起使用,
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));
这篇关于NuSOAP:如何更改请求的内容类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!