首页 > Web开发 > 详细

webservice jaxws 客户端(服务端和客户端都在本地)

时间:2019-08-12 13:35:20      阅读:109      评论:0      收藏:0      [点我收藏+]

在本地调用测试接口

public class Clent {

public static void main(String[] args) throws Exception {

QName serviceName = new QName("http://ws.sams.hcycom.com/", "ClearTicketServiceService");
QName portName = new QName("http://ws.sams.hcycom.com/", "ClearTicketServicePort");
String addr = "http://localhost:8080/ws/clearTicket?wsdl";
URL url = new URL(addr);
Service service = Service.create(url, serviceName);
IClearTicketServiceDelegate port = service.getPort(portName, IClearTicketServiceDelegate.class);
String result=port.clearTicket("" +
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
"\t<request>\n" +
"\t\t<faultsheet>\n" +
"\t\t\t<sheetNo>resp.getSheetNo()114221</sheetNo>\n" +
"\t\t </faultsheet>\n" +
"\t</request>\n");
System.out.println("result:" + result);


}
}

webservice jaxws 客户端(服务端和客户端都在本地)

原文:https://www.cnblogs.com/dhqz/p/11338755.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!