使用wsimport生成客户端java类

wsimport -keep -p cc.hansam http://192.168.1.124:1533/ws/shi?wsdl

使用生成的客户端调用服务


<definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://support.ws.integration.server.odb.product.uinnova.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://support.ws.integration.server.odb.product.uinnova.com/" name="WSServiceImplService">
<types>
<xsd:schema>
<xsd:import namespace="http://support.ws.integration.server.odb.product.uinnova.com/" schemaLocation="http://192.168.1.124:1533/ws/shi?xsd=1"/>
</xsd:schema>
</types>
<message name="call">
<part name="parameters" element="tns:call"/>
</message>
<message name="callResponse">
<part name="parameters" element="tns:callResponse"/>
</message>
<portType name="WSServiceImpl">
<operation name="call">
<input wsam:Action="http://support.ws.integration.server.odb.product.uinnova.com/WSServiceImpl/callRequest" message="tns:call"/>
<output wsam:Action="http://support.ws.integration.server.odb.product.uinnova.com/WSServiceImpl/callResponse" message="tns:callResponse"/>
</operation>
</portType>
<binding name="WSServiceImplPortBinding" type="tns:WSServiceImpl">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<operation name="call">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="WSServiceImplService">
<port name="WSServiceImplPort" binding="tns:WSServiceImplPortBinding">
<soap:address location="http://192.168.1.124:1533/ws/shi"/>
</port>
</service>
</definitions>

调用

package cc.hansam.java.net.ws.odb;

/**
 * 通过wsimport生成的客户端代码调用webservice服务
 * 
 * @author hansam 945210972@qq.com
 * @date 2017年7月24日下午3:03:19
 */
public class App {

    public static void main(String[] args) {
        WSServiceImplService service = new WSServiceImplService();

        WSServiceImpl po = service.getWSServiceImplPort();

        String call = po.call("");

        System.out.println(call);
    }

}
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值