来自WCF Web服务的415状态代码 [英] 415 status code from WCF Web Service
问题描述
         我正在调用WCF Web服务URL https://host/Service.svc。我的客户端是Apache HttpClient。
I am invoking a WCF Web Service URL https://host/Service.svc. My client is Apache HttpClient.
我得到' 服务器无法为请求提供服务,因为媒体类型不受支持。'
I get ' The server cannot service the request because the media type is unsupported.'
我将整个SOAP信封传递给此服务并假设没有身份验证问题。我认为已经解决了。
I pass my entire SOAP envelope to this service and assume there is no authentication issue. I believe that is resolved.
什么可能导致返回此状态代码?
What could cause this status code to be returned ?
我的SOAP信封以
<?xml version = \" 1.0 \"编码= \" UTF-8\" ?>
<?xml version=\"1.0\" encoding=\"utf-8\" ?>
后跟包络内容,包括SOAP标头,SOAP正文等。即使SOAP信封有标题
followed by the envelop contents including the SOAP header , SOAP body etc. Even though the SOAP envelope has the headers
我也设置了上面显示的代码中的请求标头。
I also set a request header in code shown above.
我可以请求传递给WCF服务的基本SOAP信封吗?
Can I request for a basic SOAP envelope that is passed to a WCF service ?
谢谢,
Mohan
推荐答案
HTTP 415是无效的媒体类型错误。除非您被告知WCF Web服务正在使用SOAP,否则任何WCF SOA解决方案都使用XML而不是SOAP作为媒体类型,默认情况下。
HTTP 415 is invalid media type error. Unless you are being told that a WCF Web service is using SOAP, then any WCF SOA solution is using XML and not SOAP as the media type, the default.
这篇关于来自WCF Web服务的415状态代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!