webservice 客户端对应xml解析

本地测试用例:

<!--
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
}
}

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值