在本地调用测试接口
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