搜狗首页  |   服务首页  |   客服热线:010-56898080

WebService介绍  |  完整的soap例子

下面是 和 SoapUI 中获取的请求和响应信息例子

请求头信息 :

<soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/ " xmlns:v1=" http://api.sogou.com/sem/common/v1 " xmlns:v11=" https://api.sogou.com/sem/sms/v1 ">
<soapenv:Header>
<v1:AuthHeader>
<v1:agentusername> </v1:agentusername>
<v1:agentpassword> </v1:agentpassword>
<v1:username> </v1:username>
<v1:token> </v1:token>
<v1:adType> </v1:adType>
</v1:AuthHeader>
</soapenv:Header>
<soapenv:Body>
<v11:getAccountFileRequest/>
</soapenv:Body>
</soapenv:Envelope>


响应头信息 :

<soap:Envelope xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/ ">
<soap:Header>
<ns3:ResHeader xmlns:ns3=" http://api.sogou.com/sem/common/v1 " xmlns:ns2=" https://api.sogou.com/sem/sms/v1 ">
<ns3:desc>failure</ns3:desc>
<ns3:failures>
<ns3:code>8</ns3:code>
<ns3:message>Error password</ns3:message>
<ns3:position>_params</ns3:position>
<ns3:content/>
</ns3:failures>
<ns3:oprs>0</ns3:oprs>
<ns3:status>2</ns3:status>
</ns3:ResHeader>
</soap:Header>
<soap:Body/>
</soap:Envelope>


完整的 SOAP 例子 :

1. 完整的 soap 请求

<soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/ " xmlns:v1=" http://api.sogou.com/sem/common/v1 " xmlns:v11=" https://api.sogou.com/sem/sms/v1 ">
<soapenv:Header>
<v1:AuthHeader>
<!--Optional:-->
<v1:agentusername>xxxxxxxx</v1:agentusername>
<!--Optional:-->
<v1:agentpassword>xxxxxxxx</v1:agentpassword>
<v1:username>xxxxxxxx</v1:username>
<v1:password>xxxxxxxx</v1:password>
<v1:token>xxxxxxxx</v1:token>
</v1:AuthHeader>
</soapenv:Header>
<soapenv:Body>
<v11:getAccountFileRequest>
<accoutFileRequest>
<cpcPlanIds>7189</cpcPlanIds>
<includeTemp>true</includeTemp>
<includeQuality>true</includeQuality>
<format>1</format>
</accoutFileRequest>
</v11:getAccountFileRequest>
</soapenv:Body>
</soapenv:Envelope>


2. 完整的 soap 响应

<soap:Envelope xmlns:soap=" http://schemas.xmlsoap.org/soap/envelope/ ">
<soap:Header>
<ns3:ResHeader xmlns:ns3=" http://api.sogou.com/sem/common/v1 " xmlns:ns2=" https://api.sogou.com/sem/sms/v1 ">
<ns3:desc>success</ns3:desc>
<ns3:oprs>1</ns3:oprs>
<ns3:oprtime>0</ns3:oprtime>
<ns3:status>0</ns3:status>
</ns3:ResHeader>
</soap:Header>
<soap:Body>
<ns2:getAccountFileResponse xmlns:ns2=" https://api.sogou.com/sem/sms/v1 " xmlns:ns3=" http://api.sogou.com/sem/common/v1 ">
<accountFileId>f4696b4f528efcb44201bbe56c57b618</accountFileId>
</ns2:getAccountFileResponse>
</soap:Body>
</soap:Envelope>