我正在使用Fiddler向我的web服务发送一个soap请求。我在使用控制台应用程序客户端(带有服务引用代理)时捕获了来自服务的请求。通过服务引用客户端的请求工作得很好。然而,当我在fiddler中使用相同的请求数据时,我得到了一个400错误的请求错误。我在fiddler中使用的请求数据如下所示。任何指导都是很棒的!
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<To s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://localhost:51909/Service1.svc</To>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/IService1/Test</Action>
</s:Header>
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Test xmlns="http://tempuri.org/">
<request>
<Data xmlns="http://www.hr-xml.org/3">
<Position>
<DocID>1234556677</DocID>
</Position>
</Data>
</request>
</Test>
</s:Body>
</s:Envelope>在fiddler中使用以下内容标头
内容长度: 786内容类型:文本/xml SoapAction:http://tempuri.org/Service1/Test
编辑:我找到了确切的错误,但我不确定它是什么意思。错误是寻址版本'AddressingNone (http://schemas.microsoft.com/ws/2005/05/addressing/none)‘不支持添加WS-Addressing标头。有什么想法吗?
发布于 2011-01-11 07:23:16
您的服务上的MessageVersion似乎未设置为接受WS-Addressing。您必须删除Soap标头" to“和"Action”,或者将MessageVersion设置为允许WS-Addressing。
http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.messageversion.aspx
如果这不起作用,请发布您的服务配置。
https://stackoverflow.com/questions/4598837
复制相似问题