微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

WebService调用客户端代码

axis方式


public void axisCall() {


String url="http://localhost:7701//GrpCustInfoSer?WSDL";
try {
String xml = GrpCustInfoSer.readFileByChars("src/集团客户资料.xml");
Service serv = new Service();
Call call;
call = (Call) serv.createCall();
call.setTargetEndpointAddress(url);
call.setoperationName(new QName(url,"GrpCustInfoSer"));
call.addParameter("string",XMLType.XSD_STRING,ParameterMode.IN); 
String result1 = (String) call.invoke(new Object[] { xml });


System.out.println("result111111 is " + result1);
} catch (Exception e) {
// Todo Auto-generated catch block
e.printstacktrace();
}
}

web_service.xml


<web-service targetNamespace="http://www.chinaunicom.com.cn/bj/GrpAcctInfoSer" uri="/GrpAcctInfoSer" style="rpc" name="GrpAcctInfoSer" protocol="http"> <components> <java-class name="jcComp0" class-name="com.blc.GrpAcctInfoSer"> </java-class> </components> <operations> <operation method="GrpAcctInfoSer" component="jcComp0"></operation> </operations> </web-service> targetNamespace="http://www.chinaunicom.com.cn/bj/GrpAcctInfoSer" uri="/GrpAcctInfoSer" style="rpc" name="GrpAcctInfoSer" protocol="http"> <components> <java-class name="jcComp0" class-name="com.blc.GrpAcctInfoSer"> </java-class> </components> <operations> <operation method="GrpAcctInfoSer" component="jcComp0"></operation> </operations> </web-service>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐