Postman 测试 Web Service 和 WCF

一、postman 测试web service
(1)设置url
  http://www.oorsprong.org/websamples.countryinfo/countryinfoservice.wso?WSDL 是一个webservices接口,可以查询国家信息
(2)设置请求方法:post

(3)设置Header

  根据 SOAP service 设置 Content-Type 为application/xml or text/xml
  所以添加Content-Type = text/xml。

(4)设置Body

  勾选raw,并选择xml 格式。
  因为WebService通过HTTP协议发送请求和接收结果时,发送的请求内容和结果内容都采用XML格式封装,并增加了一些特定的HTTP消息头,以说明 HTTP消息的内容格式,这些特定的HTTP消息头和XML内容格式就是SOAP协议。

 如图

二、postman 测试WCF
(1)设置url
  http://test.svc 是一个WCF接口
(2)设置请求方法:post

(3)设置Header

  a.根据 SOAP service 设置 Content-Type 为application/xml or text/xml
    Content-Type = text/xml
  b.添加请求的接口方法 ,可以从服务的 http://test.svc?singleWSDL 定义文档中查到
    soapAction = http://tempuri.org/IUpgrade/Authentication

  如图

  

(4)设置Body

  勾选raw,并选择xml 格式。  
  可以从WCF 测试客户端设置并复制请求参数,但注意要删除header节点,否则请求不能成功

  如图

  

 参考资料 

postman 官方文档

https://www.thetopsites.net/article/58701518.shtml

 

posted @ 2020-10-20 17:37  虹色流星雨  阅读(1124)  评论(0编辑  收藏  举报