使用fiddler测试wcf

来源:互联网 发布:3g模型淘宝 编辑:程序博客网 时间:2024/05/29 23:48

wcf-test-client固然是一个非常好的wcf测试工具,然而有时候因为元数据节点的问题不能添加进去,这就比较麻烦了。

理论上,http绑定的wcf是可以使用http的方式直接进行提交的,那fiddler显然是个好选择。

丢人的是,测试了一次没成功之后,也没多想,就放下了。这次又试了一下,终于可以了,注意事项如下:

1. request header

Content-Type: text/xmlSOAPAction: "http://www.dominos.com/action/PlaceOrder"

2. request method

get/post,视调用的wcf action而定

3. request body

填入wcf的序列化body就好。自己组织。

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">  <s:Body>    <Place xmlns="http://order.service.dominos.com/ServiceContract">      <o xmlns:a="http://order.service.dominos.com/DataContract" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">        <a:Address>上海市天钥桥路380弄20-28号</a:Address>        <a:ChannelId>test</a:ChannelId>              </o>    </Place>  </s:Body></s:Envelope>


0 0