新手求解 java调用webservice接口 如何获取返回值

crackpotCD 2014-09-29 11:12:57
java部分该怎么写?

RPCServiceClient rpcClient = new RPCServiceClient();
Options opt = new Options();
opt.setTo(new EndpointReference("http://10.130.36.87:8081/usp/services/InnerSysPublishInfoServiceFacadeImpl")); // 服务地址
opt.setAction(""); // 方法
rpcClient.setOptions(opt);
OMElement element = rpcClient.invokeBlocking(new QName("http://10.130.36.87:8081/usp/services/InnerSysPublishInfoServiceFacadeImpl", "login"),
new Object[] { "000027" ,"000027"}); // null表示没有参数传递

Iterator values = element.getChildrenWithName(new QName(
"http://10.130.36.87:8081/usp/services/InnerSysPublishInfoServiceFacadeImpl", "login", "return"));



<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://10.130.36.87:8081/usp/services/InnerSysPublishInfoServiceFacadeImpl" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://10.130.36.87:8081/usp/services/InnerSysPublishInfoServiceFacadeImpl" xmlns:intf="http://10.130.36.87:8081/usp/services/InnerSysPublishInfoServiceFacadeImpl" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.4
Built on Apr 22, 2006 (06:55:48 PDT)-->
<wsdl:types>
<schema targetNamespace="http://10.130.36.87:8081/usp/services/InnerSysPublishInfoServiceFacadeImpl" xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<complexType name="ArrayOfArrayOf_soapenc_string">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="soapenc:string[][]"/>
</restriction>
</complexContent>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="loginResponse">

<wsdl:part name="loginReturn" type="soapenc:string"/>

</wsdl:message>
<wsdl:message name="loginRequest">

<wsdl:part name="loginID" type="soapenc:string"/>

<wsdl:part name="loginPWD" type="soapenc:string"/>

</wsdl:message>

<wsdl:portType name="InnerSysPublishInfoServiceFacadeImpl">

<wsdl:operation name="login" parameterOrder="loginID loginPWD">

<wsdl:input message="impl:loginRequest" name="loginRequest"/>

<wsdl:output message="impl:loginResponse" name="loginResponse"/>

</wsdl:operation>
</wsdl:portType>

<wsdl:binding name="InnerSysPublishInfoServiceFacadeImplSoapBinding" type="impl:InnerSysPublishInfoServiceFacadeImpl">

<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl:operation name="login">

<wsdlsoap:operation soapAction=""/>

<wsdl:input name="loginRequest">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://10.130.36.87:8081/usp/services/InnerSysPublishInfoServiceFacadeImpl" use="encoded"/>

</wsdl:input>

<wsdl:output name="loginResponse">

<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://10.130.36.87:8081/usp/services/InnerSysPublishInfoServiceFacadeImpl" use="encoded"/>

</wsdl:output>

</wsdl:operation>
</wsdl:binding>

<wsdl:service name="InnerSysPublishInfoServiceFacadeImplService">

<wsdl:port binding="impl:InnerSysPublishInfoServiceFacadeImplSoapBinding" name="InnerSysPublishInfoServiceFacadeImpl">

<wsdlsoap:address location="http://10.130.36.87:8081/usp/services/InnerSysPublishInfoServiceFacadeImpl"/>

</wsdl:port>

</wsdl:service>

</wsdl:definitions>
...全文
443 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
EverWHL 2014-09-29
  • 打赏
  • 举报
回复
返回的是xml文件 可以用jquery解析xml 也可以用java解析xml文件

81,092

社区成员

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

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