zoukankan      html  css  js  c++  java
  • 使用wsimport生成客户端代码

    概述


    wsimport是jdk自带的命令,可以根据wsdl文档生成客户端中间代码,基于生成的代码编写客户端,可以省很多麻烦。

    wsimport命令


    wsimport的用法
    wsimport [options] <WSDL_URI>
    比较常用的[options]有:
    1. -d <directory>
       在指定的目录生成class文件
    2. -clientjar <jarfile>
       在当前目录生成jar文件,结合-d <directory>可以在指定的目录生成jar文件
    3. -s <directory>
       在指定的目录生成java源文件
    4. -p <pkg>
       指定生成文件的包结构
    5. -keep

       在生成class文件,或者jar包时,同时保留java源文件


    常用的组合

    1. 在指定的目录生成指定包结构的java源文件
      假设wsdl文档的uri为http://localhost:6666/service/interpret?wsdl,那么在F: emp下,生成包结构为cn.ljl.sand.jws.chapter3.client.wsimport的java源文件的命令为:

      wsimport -s F:	emp -p cn.ljl.sand.jws.chapter3.client.wsimport http://localhost:6666/service/interpret?wsdl
       
    2. 在指定的目录生成指定包结构的jar文件
      假设wsdl文档的uri为http://localhost:6666/service/interpret?wsdl,那么在F: emp下,生成包结构为cn.ljl.sand.jws.chapter3.client.wsimport的interpret-wsimport.jar的命令为:
      wsimport -d F:	emp -clientjar interpret-wsimport.jar -p cn.ljl.sand.jws.chapter3.client.wsimport http://localhost:6666/service/interpret?wsdl
    转载自:https://www.cnblogs.com/ywjy/p/5196064.html

  • 相关阅读:
    设计模式学习总结系列应用实例
    【研究课题】高校特殊学生的发现及培养机制研究
    Linux下Oracle11G RAC报错:在安装oracle软件时报file not found一例
    python pro practice
    openstack python sdk list tenants get token get servers
    openstack api
    python
    git for windows
    openstack api users list get token get servers
    linux 流量监控
  • 原文地址:https://www.cnblogs.com/DiZhang/p/12545120.html
Copyright © 2011-2022 走看看