求Java使用SOAP获取webservice的代码。
各位好!
我自己根据网上的范例写的client请求一样报header有误,求熟悉的人给个client请求代码,或给个指引。万分感谢!
webservice接口通过浏览器访问格式如下(SOPA1.1):
---------------------------------------------------------------------
POST /PointProject/Point.asmx HTTP/1.1
Host: 10.92.2.135
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/QueryActiveImei"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<CredentialSoapHeader xmlns="http://tempuri.org/">
<UserName>string</UserName>
<UserPassword>string</UserPassword>
</CredentialSoapHeader>
</soap:Header>
<soap:Body>
<QueryActiveImei xmlns="http://tempuri.org/">
<date>string</date>
<page>int</page>
</QueryActiveImei>
</soap:Body>
</soap:Envelope>
-----------------(返回格式)-----------------
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<QueryActiveImeiResponse xmlns="http://tempuri.org/">
<QueryActiveImeiResult>string</QueryActiveImeiResult>
</QueryActiveImeiResponse>
</soap:Body>
</soap:Envelope>