高手请指教WebServices只有wsdl文件调用服务的问题

tyg 2014-05-06 12:33:34
请问大家,只有对方给提供的”接口.wsdl“和iP地址信息,能否使用Java调用服务返回数据么?

<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns:tns="web.service.beans"
xmlns:wsr="http://www.openuri.org/2002/10/soap/reliability/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap12enc="http://www.w3.org/2003/05/soap-encoding"
xmlns:conv="http://www.openuri.org/2002/04/wsdl/conversation/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="web.service.beans">
<message name="interFace">
<part xmlns:partns="http://www.w3.org/2001/XMLSchema"
type="partns:string"
name="string">
</part>
</message>
<message name="interFaceResponse">
<part xmlns:partns="http://www.w3.org/2001/XMLSchema"
type="partns:string"
name="result">
</part>
</message>
<portType name="interFaceBeanPort">
<operation name="interFace">
<input message="tns:interFace">
</input>
<output message="tns:interFaceResponse">
</output>
</operation>
</portType>
<binding type="tns:interFaceBeanPort"
name="interFaceBeanPort">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http">
</soap:binding>
<operation name="interFace">
<soap:operation style="rpc"
soapAction="">
</soap:operation>
<input>
<soap:body namespace="web.service.beans"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
use="encoded">
</soap:body>
</input>
<output>
<soap:body namespace="web.service.beans"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
use="encoded">
</soap:body>
</output>
</operation>
</binding>
<service name="interFaceBean">
<port name="interFaceBeanPort"
binding="tns:interFaceBeanPort">
<soap:address location="http://195.186.20.25:8009/webservices/interFaceBean">
</soap:address>
</port>
</service>
</definitions>
...全文
166 4 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
yn799890274 2014-05-06
  • 打赏
  • 举报
回复
可以,例子用的是xfire // 远程webService的URL String hostUrl = ***; // 创建客户实例 Client client = new Client(new URL(hostUrl)); // 返回执行结果 Object[] results = client.invoke(methodName, new Object[] {参数}); String result = results[0].toString();
tony4geek 2014-05-06
  • 打赏
  • 举报
回复
suciver 2014-05-06
  • 打赏
  • 举报
回复
wsdl中就包含了接口所暴露出来的服务(也就是方法)以及这些service需要的参数。
haozhongjun 2014-05-06
  • 打赏
  • 举报
回复
额需要方法名,方法参数,接口.wsdl还有iP地址信息吧!!

81,122

社区成员

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

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