【问题标题】:Dealing with SOAP Request with No SoapAction in Header在标头中没有 SoapAction 处理 SOAP 请求
【发布时间】:2011-10-10 07:51:55
【问题描述】:

我有一个问题。我有一个 Axis 客户端正在调用的 .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

【问题讨论】:

  • 在 WSDL 绑定中是否正确填写了soapaction?

标签: .net web-services soap axis


【解决方案1】:

自己解决了。需要补充:

[SoapDocumentService(RoutingStyle=SoapServiceRoutingStyle.RequestElement)]

到服务定义。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多