求Java使用SOAP获取webservice的代码。

lulin99 2015-08-04 03:30:52
各位好!
我自己根据网上的范例写的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>
...全文
131 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Giberson1 2015-08-05
  • 打赏
  • 举报
回复
eclipse自动有project client的向导。
tony4geek 2015-08-04
  • 打赏
  • 举报
回复
tony4geek 2015-08-04
  • 打赏
  • 举报
回复
  • 打赏
  • 举报
回复
webservice我都是用wsdl生成客户端

81,122

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧