漂泊雪狼的博客

思考,讨论,分享C#,JavaScript,.NET,Oracle,SQL Server……技术

导航

使用Fiddler 4 调用WebService

Posted on 2018-05-15 11:07  漂泊雪狼  阅读(2685)  评论(0编辑  收藏  举报

Fiddler让我们这些.neter感到非常欣慰, 是用C#写出来的,它包含一个简单却功能强大的基于JScript .NET 事件脚本子系统,它的灵活性非常棒,可以支持众多的http调试任务,并且能够使用.net框架语言进行扩展。

调用webservice需要设置正确的请求头,以下为例子,每个webserive的请求头可能不一样,具体根据ws提供方来确定

请求头:

User-Agent: Fiddler
SOAPAction: "http://tempuri.org/GetObList"
Host: **IP
Content-Length: 329
Expect: 100-continue
Content-Type: text/xml; charset=utf-8

传入值

<?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><GetObList xmlns="http://tempuri.org/"><time>2018-01-01T00:00:00</time></GetObList></soap:Body></soap:Envelope>

 

 点击Execute显示调用结果

 

 

 

 Fiddler调试WebApi注意事项:

1、需指定请求上下文类型,否则有些api可能会调用报错,例如 Content-Type: application/json

2、