如何捕获WCF Web服务的原始SOAP请求

时间:2013-05-04 02:14:23

标签: wcf soap fiddler

我已经seen several questions关于这一点,但没有明确的演练如何捕获到WCF Web服务的SOAP请求。他们只是说“去安装Fiddler2”。所有我可以摆脱fiddler的是普通的HTTP请求,但由于某些原因我永远无法获得原始SOAP请求任何人都可以指导我阅读这个特定场景的教程吗?

.NET Web应用程序在WCF Web服务上调用basicHTTP端点。我需要捕获原始SOAP请求。我正在寻找一个完整的演练,因为我不是出于某种原因想要这个概念。

更新

这是我从Fiddler的原始视图中得到的结果:

POST http://vm05/PNSWebTestVB/ HTTP/1.1
Accept: text/html, application/xhtml+xml, */*
Referer: http://vm05/PNSWebTestVB/
Accept-Language: en-US
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: vm05
Content-Length: 2272
Connection: Keep-Alive
Pragma: no-cache

__EVENTTARGET=&__EVENTARGUMENT=&__VIEWSTATE=%2FwEPDwUKLTM4MDU0OTMyOQ9kFgICAw9kFgICeQ8WAh4HVmlzaWJsZWcWBgIBDw8WAh4EVGV4dAXKATx0YWJsZSB3aWR0aD0nMTAwJSc%2BPHRyPjx0ZD48c3Ryb25nPlN0YXJ0ZWQ6PC9zdHJvbmc%2BIDg6Mjg6MTguNzA3IEFNPC90ZD48dGQgYWxpZ249J2NlbnRlcic%2BPHN0cm9uZz5FbmRlZDo8L3N0cm9uZz4gODoyODoyMC41ODUgQU08L3RkPjx0ZCBhbGlnbj0ncmlnaHQnPjxzdHJvbmc%2BVG90YWw6PC9zdHJvbmc%2BIDEuODggc2Vjb25kczwvdGQ%2BPC90YWJsZT5kZAIDDw8WAh8BBXk8aDQ%2BQ3JlYXRlIFRyYW5zYWN0aW9uIFNlcnZpY2UgUmV0dXJuPC9oND48Yj5Cb29sZWFuIHJlc3VsdDo8L2I%2BIFRydWU8YnIvPjxiIHN0eWxlPSdjb2xvcjpnc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UC66sgsPgZkHYlVHbiQOw0WXZZ5cbdYYXwr661mJ89CqNL7SXM5bHdHZdc8mjZKMhnMRSoTaHKS7nhfvrD%2Fx3IhQquPfSBscM%2BEl0ZjjjtTdVzRZn7DFyWrI8V%2FOY8R04aPRKvp5noI1x8SosQ8JtOO%2BaYKnFL9NCi0aug5qlXDG2aEfC1liIw8tcyTKyO4O3QU2jwgyGg0Cn1uu04sysgxEFpobCcsYBC13vLf00%2BldhvJhee6%2Fsf7z7jMzjigjz9OJ9sLxDWTNf435wga8mfxrwE8QZdUUwumdHowAQUaobtRYmVoJUTgx0Kzlww2Q0Vmf7egxEzjWuWP9tjw%3D&txtProntoID=_CleanInstallSite&txtAuthData=password&txtUsername=apiuser&txtUserPassword=@lph@deV2&ddlProtocol=http%3A%2F%2F&txtDomain=vm05.alphatrust.local&btnCreateTest2=Create+New+Transaction+2&txtTransactionID=&txtParticipantID=&txtDocumentID=&txtMetaDataName=&txtMetaDataValue=&txtTaskID=&txtAttachmentID=

更新2

我甚至不确定Fiddler客户端如何首先看到SOAP。 Fiddler(根据我的理解)拦截来自浏览器的客户端流量(这只是一个表单帖子),表单帖子告诉服务器上的应用程序在另一台服务器上(或在同一服务器上)调用WCF应用程序的Web服务在这种情况下服务器)然后WCF将响应数据发送回调用服务器。然后调用服务器只返回客户端的网页。所以,我所看到的就是客户端流量与服务器流量无关(即使客户端,呼叫服务器和WCF服务器在我的测试用例中都是同一台机器)。

1 个答案:

答案 0 :(得分:11)

Fiddler是一个代理服务器。

它显示来自任何客户端的流量,该客户端配置为指向它。我你说你有一个网络浏览器向服务器发出请求,而服务器又使用SOAP向另一个服务器发出请求?如果是这种情况,则需要在前端服务器上运行Fiddler,并配置ASPX或发出SOAP请求以指向Fiddler的任何内容。

http://fiddler2.com/blog/blog/2013/01/08/capturing-traffic-from-.net-services-with-fiddler