webservice 客户端对应xml解析

本地测试用例:

 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://impl.service01.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/"targetNamespace="http://impl.service01.com/" name="SayHelloImplService">
 namespace="http://impl.service01.com/" schemaLocation="http://localhost:8234/CallSayHelloService?xsd=1"/>
 name="Say">
 name="parameters" element="tns:Say"/>
 name="SayResponse">
 name="parameters" element="tns:SayResponse"/>
 name="SayHelloImpl">
 name="Say">
 message="tns:Say"/>
 message="tns:SayResponse"/>
 name="SayHelloImplPortBinding" type="tns:SayHelloImpl">
 transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
 name="Say">
 soapAction=""/>
 use="literal"/>
 use="literal"/>
 name="SayHelloImplService">
 name="SayHelloImplPort" binding="tns:SayHelloImplPortBinding">
 location="http://localhost:8234/CallSayHelloService"/>

webservice客户端解析出来后的java类:


调用客户端程序:

public class Server01ClientTest {
public static void main(String[] args){
SayHelloImplService aa=new SayHelloImplService();//对应Service标签
SayHelloImpl s=aa.getSayHelloImplPort();//SayHelloImpl对应service的binding标签
System.out.println("客户端调用成功:");
String ss=s.say("Jcak");//对应binding调用的方法标签operation
}
}

你可能感兴趣的:(webService)