soap - 如何使用Fiddler2查看ASMX SOAP?

标签 soap asmx fiddler

有谁知道 Fiddler 是否可以显示 ASMX Web 服务的原始 SOAP 消息?我正在使用 Fiddler2 和 Storm 测试一个简单的 Web 服务,结果各不相同(Fiddler 显示纯 xml,而 Storm 显示 SOAP 消息)。请参阅下面的示例请求/响应:

Fiddler2 请求:

POST /webservice1.asmx/Test HTTP/1.1
Accept: */*
Referer: http://localhost.:4164/webservice1.asmx?op=Test
Accept-Language: en-us
User-Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2; MS-RTC LM 8)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: localhost.:4164
Content-Length: 0
Connection: Keep-Alive
Pragma: no-cache

Fiddler2 响应:

HTTP/1.1 200 OK
Server: ASP.NET Development Server/9.0.0.0
Date: Thu, 21 Jan 2010 14:21:50 GMT
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 96
Connection: Close
<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://tempuri.org/">Hello World</string>

Storm 请求(仅正文):

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <Test xmlns="http://tempuri.org/" />
  </soap:Body>
</soap:Envelope>

Storm 响应:

 Status Code: 200
 Content Length : 339
 Content Type: text/xml; charset=utf-8
 Server: ASP.NET Development Server/9.0.0.0
 Status Description: OK

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <TestResponse xmlns="http://tempuri.org/">
      <TestResult>Hello World</TestResult>
    </TestResponse>
  </soap:Body>
</soap:Envelope>

感谢您的帮助。

最佳答案

响应不同是因为请求不同。您的 Fiddler2 请求不包含任何内容和 SOAP header ,因此它获得的响应是​​标准 XML 响应。

另一方面,您的 Storm 请求正在发布 SOAP 请求正文(而且,我假设,SOAP 请求 header ,尽管它们没有被包括在内)。因为 Web 服务是使用 SOAP 调用的,所以响应将是 SOAP。

关于soap - 如何使用Fiddler2查看ASMX SOAP?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2148107/

相关文章:

python - Fiddler 没有捕获我脚本的请求

javascript - nodeJs soap 库无法将请求发送到 wsdl url

php - SoapClient : how to pass multiple elements with same name?

.net - .NET WebMethods 中 @WebParam 的等效项是什么?

c# - IIS/.NET 3.5 的 X-Sendfile 或 X-Accel-Redirect 等效项

python - 如何在fiddler中捕获python https流量?

sharepoint - 如何以编程方式在 Sharepoint 中创建 wiki 页面 (=item)?

SOAP 1.2 通过 SSL + HTTP 基本身份验证还是 WS-Security?

php - 使用 curl 来使用此 Web 服务

http - 使用文件和 xml 内容发出 POST 请求