本地测试用例:
<!--
Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6.
-->
<!--
Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.1.6 in JDK 6.
-->
<definitions 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">
<types>
<xsd:schema>
<xsd:import namespace="http://impl.service01.com/" schemaLocation="http://localhost:8234/CallSayHelloService?xsd=1"/>
</xsd:schema>
</types>
<message name="Say">
<part name="parameters" element="tns:Say"/>
</message>
<message name="SayResponse">
<part name="parameters" element="tns:SayResponse"/>
</message>
<portType name="SayHelloImpl">
<operation name="Say">
<input message="tns:Say"/>
<output message="tns:SayResponse"/>
</operation>
</portType>
<binding name="SayHelloImplPortBinding" type="tns:SayHelloImpl">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="Say">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="SayHelloImplService">
<port name="SayHelloImplPort" binding="tns:SayHelloImplPortBinding">
<soap:address location="http://localhost:8234/CallSayHelloService"/>
</port>
</service>
</definitions>
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
}
}