POSTMAN调用webservice

/ 0条评论 / 0 个点赞 / 2246人阅读

postman调用一般就是用post方式,参数使用xm格式。

比如,有一个webservice:http://192.168.1.124:18080/subo/service/subo?wsdl。
要调用的话,只需要注意两点。

请求结果
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<!--
 Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3-hudson-390-. 
-->
<!--
 Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.3-hudson-390-. 
-->
<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.cchicc.org.cn" xmlns:xsd="http://www.w3.org/2001/XMLSchema"xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.cchicc.org.cn" name="subo">
<types/>
<message name="receiveRepairResult">
<part name="arg0" type="xsd:string"/>
</message>
<message name="receiveRepairResultResponse">
<part name="return" type="xsd:string"/>
</message>
<message name="getGWShareCulList">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
</message>
<message name="getGWShareCulListResponse">
<part name="return" type="xsd:string"/>
</message>
<message name="getHisHandingTask">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
<part name="arg2" type="xsd:string"/>
<part name="arg3" type="xsd:string"/>
<part name="arg4" type="xsd:string"/>
<part name="arg5" type="xsd:string"/>
</message>
<message name="getHisHandingTaskResponse">
<part name="return" type="xsd:string"/>
</message>
<message name="getShareCulList">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
<part name="arg2" type="xsd:string"/>
</message>
<message name="getShareCulListResponse">
<part name="return" type="xsd:string"/>
</message>
<message name="getHandleTask">
<part name="arg0" type="xsd:string"/>
<part name="arg1" type="xsd:string"/>
<part name="arg2" type="xsd:string"/>
<part name="arg3" type="xsd:string"/>
<part name="arg4" type="xsd:string"/>
<part name="arg5" type="xsd:string"/>
</message>
<message name="getHandleTaskResponse">
<part name="return" type="xsd:string"/>
</message>
<portType name="SuboWebService">
<operation name="receiveRepairResult">
<input message="tns:receiveRepairResult"/>
<output message="tns:receiveRepairResultResponse"/>
</operation>
<operation name="getGWShareCulList" parameterOrder="arg0 arg1">
<input message="tns:getGWShareCulList"/>
<output message="tns:getGWShareCulListResponse"/>
</operation>
<operation name="getHisHandingTask" parameterOrder="arg0 arg1 arg2 arg3 arg4 arg5">
<input message="tns:getHisHandingTask"/>
<output message="tns:getHisHandingTaskResponse"/>
</operation>
<operation name="getShareCulList" parameterOrder="arg0 arg1 arg2">
<input message="tns:getShareCulList"/>
<output message="tns:getShareCulListResponse"/>
</operation>
<operation name="getHandleTask" parameterOrder="arg0 arg1 arg2 arg3 arg4 arg5">
<input message="tns:getHandleTask"/>
<output message="tns:getHandleTaskResponse"/>
</operation>
</portType>
<binding name="SuboWebServicePortBinding" type="tns:SuboWebService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
<operation name="receiveRepairResult">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal" namespace="http://www.cchicc.org.cn"/>
</input>
<output>
<soap:body use="literal" namespace="http://www.cchicc.org.cn"/>
</output>
</operation>
<operation name="getGWShareCulList">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal" namespace="http://www.cchicc.org.cn"/>
</input>
<output>
<soap:body use="literal" namespace="http://www.cchicc.org.cn"/>
</output>
</operation>
<operation name="getHisHandingTask">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal" namespace="http://www.cchicc.org.cn"/>
</input>
<output>
<soap:body use="literal" namespace="http://www.cchicc.org.cn"/>
</output>
</operation>
<operation name="getShareCulList">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal" namespace="http://www.cchicc.org.cn"/>
</input>
<output>
<soap:body use="literal" namespace="http://www.cchicc.org.cn"/>
</output>
</operation>
<operation name="getHandleTask">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal" namespace="http://www.cchicc.org.cn"/>
</input>
<output>
<soap:body use="literal" namespace="http://www.cchicc.org.cn"/>
</output>
</operation>
</binding>
<service name="subo">
<port name="SuboWebServicePort" binding="tns:SuboWebServicePortBinding">
<soap:address location="http://192.168.1.124:18080/subo/service/subo"/>
</port>
</service>
</definitions>


设置post方式

header上要设置:Content-Type:text/xml;charset=utf-8

参数
<?xml version="1.0" encoding="utf-16"?>
<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>
    <getGWShareCulList xmlns="http://www.cchicc.org.cn">
      <arg0>1</arg0>
      <arg1>2</arg1>
    </getGWShareCulList>
  </soap:Body>
</soap:Envelope>
注意

getGWShareCulList:方法名

arg0:参数名