处理Header中没有SoapAction的SOAP请求

时间:2011-10-10 07:51:55

标签: .net web-services soap axis

我有一个问题。我有一个由.NET客户端调用的.NET SOAP Web服务。

问题是标头信息中没有SOAP Action,而IIS只是抛出500错误。客户端告诉我禁用标头验证,但我不确定如何在.NET中执行此操作。我唯一能想到的是编写一个方法来手动捕获和解析请求,这看起来很痛苦。任何帮助将不胜感激。

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
...
</soapenv:Body>
POST /Services/MyService.asmx HTTP/1.0
Content-Type: text/xml; charset=utf-8
Accept: application/soap+xml, application/dime, multipart/related, text/*
User-Agent: Axis/1.2.1
Host: 1.2.3.4:55
Cache-Control: no-cache
Pragma: no-cache
SOAPAction: ""
Content-Length: 1465

1 个答案:

答案 0 :(得分:2)

我自己解决了。需要补充:

[SoapDocumentService(RoutingStyle=SoapServiceRoutingStyle.RequestElement)]

到服务定义。

相关问题