簡體   English   中英

使用Fiddler將SOAP格式轉換為Web服務

[英]See SOAP format into web services with fiddler

我創建了一個Web服務和一個ConsoleApplication來使用它。 我正在使用提琴手來查看流量,我希望請求和響應是SOAP,但是那沒有發生,只有請求是SOAP,而不是響應。
我該如何強迫使用肥皂做出反應的服務?

這是獲得的原始http標頭:
HTTP / 1.1 200 OK
緩存控制:私有,最大年齡= 0
內容類型:text / xml; 字符集= utf-8的
內容編碼:gzip
有所不同:接受編碼
伺服器:Microsoft-IIS / 7.5
X-AspNet版本:4.0.30319
X-Powered-by:ASP.NET
日期:2014年11月17日星期一20:19:22 GMT
內容長度:311

響應是二進制的。
創建我的Web服務時,將一個Web服務項添加到ASP.NET空Web應用程序項目中,但是我沒有進行修改,后來我在IIS中發布了它。
我的消費者也很簡單。 我只是添加服務引用並創建一個實例。

var binding = new BasicHttpBinding();
var endpointAddress = new EndpointAddress("http://172.20.48.59/web-services/MyWebService.asmx");
var serviceRefWithoutConfig = new ServiceReference1.MyWebServiceSoapClient(binding, endpointAddress);
Console.WriteLine(serviceRefWithoutConfig.HelloWorld());

有問題的HTTP響應已使用GZIP壓縮。

單擊Fiddler中的大黃條表示Response is encoded and may require decoding before inspection. Click here to transform. ,然后會發生什么Response is encoded and may require decoding before inspection. Click here to transform. Response is encoded and may require decoding before inspection. Click here to transform.

如果要創建新的東西,強烈建議您考慮使用WebAPI這樣的東西。

控制方法的輸出要容易得多,並且如果將來需要的話,由此產生的服務也將更易於從移動平台使用。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM