- 浏览: 364528 次
- 性别:
- 来自: 四川
文章分类
- 全部博客 (247)
- 数据库以及sql (11)
- java (48)
- 爬虫学习 (20)
- java编程 (28)
- python编程以及安装和配置 (27)
- oracle数据库 (32)
- mongodb基本操作 (4)
- linux学习 (7)
- easyUI (2)
- nodeJs (8)
- python学习 (16)
- 其他 (13)
- hadoop (1)
- svn (1)
- 汉字 (1)
- windows (2)
- jsp (5)
- fiddler (1)
- ETL (1)
- teamviewer (1)
- maven (4)
- GIT (2)
- datagrip (1)
- ocr (1)
- redis (3)
- mysql (3)
- linux (1)
- 数据服务 (0)
最新评论
原文:http://blog.csdn.net/a19881029/article/details/40194787
1,下载Axis2插件,最新版本为1.6.2:http://www.apache.org/dyn/mirrors/mirrors.cgi/axis/axis2/java/core/1.6.2/axis2-eclipse-codegen-plugin-1.6.2.zip
2,将zip压缩包中的org.apache.axis2.eclipse.codegen.plugin_1.6.2.jar放置在%ECLIPSE_HOME%\plugins路径下
3,重启Eclipse
安装完成后就可以使用安装好的插件生成WSDL文件了
1,创建一个普通的Java项目,在该项目下创建一个接口,在Navigator视图下,项目结构如下:
[java] view plain copy 在CODE上查看代码片派生到我的代码片
package com.sean;
public interface Math {
public int add(int a, int b);
}
2,选择Eclipse菜单栏中的File -> New -> Other...,在弹出的对话框中选择Axis2 Code Generator,然后选择Next
3,然后选择通过Java源文件生成WSDL
4,Fully Qualified Class name中填写用来生成WSDL的Java类全名称
然后通过Add Folder按钮添加Java类编译后生成的.class文件(Math.class)所在路径
最后点击Test Class Loading...按钮
当测试通过时(按钮右侧显示Class file loaded successfully),才可点击Next按钮
5,WSDL文件属性值,这里使用默认的即可
6,选择将WSDL文件生成在本地文件系统,并且选择好WSDL文件的生成路径及文件名
点击Finish后,将在指定位置生成WSDL文件(Math.wsdl),文件内容如下:
[html] view plain copy
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://org.apache.axis2/xsd"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xsd="http://sean.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
targetNamespace="http://sean.com">
<wsdl:types>
<xs:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://sean.com">
<xs:element name="add">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="args0" type="xs:int"/>
<xs:element minOccurs="0" name="args1" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="addResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="addRequest">
<wsdl:part name="parameters" element="xsd:add"/>
</wsdl:message>
<wsdl:message name="addResponse">
<wsdl:part name="parameters" element="xsd:addResponse"/>
</wsdl:message>
<wsdl:portType name="MathPortType">
<wsdl:operation name="add">
<wsdl:input message="xsd:addRequest" wsaw:Action="urn:add"/>
<wsdl:output message="xsd:addResponse" wsaw:Action="urn:addResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MathSoap11Binding" type="xsd:MathPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="add">
<soap:operation soapAction="urn:add" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="MathSoap12Binding" type="xsd:MathPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="add">
<soap12:operation soapAction="urn:add" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="MathHttpBinding" type="xsd:MathPortType">
<http:binding verb="POST"/>
<wsdl:operation name="add">
<http:operation location="add"/>
<wsdl:input>
<mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Math">
<wsdl:port name="MathHttpSoap11Endpoint" binding="xsd:MathSoap11Binding">
<soap:address location="http://localhost:8080/axis2/services/Math"/>
</wsdl:port>
<wsdl:port name="MathHttpSoap12Endpoint" binding="xsd:MathSoap12Binding">
<soap12:address location="http://localhost:8080/axis2/services/Math"/>
</wsdl:port>
<wsdl:port name="MathHttpEndpoint" binding="xsd:MathHttpBinding">
<http:address location="http://localhost:8080/axis2/services/Math"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
1,下载Axis2插件,最新版本为1.6.2:http://www.apache.org/dyn/mirrors/mirrors.cgi/axis/axis2/java/core/1.6.2/axis2-eclipse-codegen-plugin-1.6.2.zip
2,将zip压缩包中的org.apache.axis2.eclipse.codegen.plugin_1.6.2.jar放置在%ECLIPSE_HOME%\plugins路径下
3,重启Eclipse
安装完成后就可以使用安装好的插件生成WSDL文件了
1,创建一个普通的Java项目,在该项目下创建一个接口,在Navigator视图下,项目结构如下:
[java] view plain copy 在CODE上查看代码片派生到我的代码片
package com.sean;
public interface Math {
public int add(int a, int b);
}
2,选择Eclipse菜单栏中的File -> New -> Other...,在弹出的对话框中选择Axis2 Code Generator,然后选择Next
3,然后选择通过Java源文件生成WSDL
4,Fully Qualified Class name中填写用来生成WSDL的Java类全名称
然后通过Add Folder按钮添加Java类编译后生成的.class文件(Math.class)所在路径
最后点击Test Class Loading...按钮
当测试通过时(按钮右侧显示Class file loaded successfully),才可点击Next按钮
5,WSDL文件属性值,这里使用默认的即可
6,选择将WSDL文件生成在本地文件系统,并且选择好WSDL文件的生成路径及文件名
点击Finish后,将在指定位置生成WSDL文件(Math.wsdl),文件内容如下:
[html] view plain copy
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:ns1="http://org.apache.axis2/xsd"
xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:xsd="http://sean.com"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
targetNamespace="http://sean.com">
<wsdl:types>
<xs:schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://sean.com">
<xs:element name="add">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="args0" type="xs:int"/>
<xs:element minOccurs="0" name="args1" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="addResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="addRequest">
<wsdl:part name="parameters" element="xsd:add"/>
</wsdl:message>
<wsdl:message name="addResponse">
<wsdl:part name="parameters" element="xsd:addResponse"/>
</wsdl:message>
<wsdl:portType name="MathPortType">
<wsdl:operation name="add">
<wsdl:input message="xsd:addRequest" wsaw:Action="urn:add"/>
<wsdl:output message="xsd:addResponse" wsaw:Action="urn:addResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MathSoap11Binding" type="xsd:MathPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="add">
<soap:operation soapAction="urn:add" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="MathSoap12Binding" type="xsd:MathPortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="add">
<soap12:operation soapAction="urn:add" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="MathHttpBinding" type="xsd:MathPortType">
<http:binding verb="POST"/>
<wsdl:operation name="add">
<http:operation location="add"/>
<wsdl:input>
<mime:content type="application/xml" part="parameters"/>
</wsdl:input>
<wsdl:output>
<mime:content type="application/xml" part="parameters"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Math">
<wsdl:port name="MathHttpSoap11Endpoint" binding="xsd:MathSoap11Binding">
<soap:address location="http://localhost:8080/axis2/services/Math"/>
</wsdl:port>
<wsdl:port name="MathHttpSoap12Endpoint" binding="xsd:MathSoap12Binding">
<soap12:address location="http://localhost:8080/axis2/services/Math"/>
</wsdl:port>
<wsdl:port name="MathHttpEndpoint" binding="xsd:MathHttpBinding">
<http:address location="http://localhost:8080/axis2/services/Math"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
发表评论
-
java字符串 与 ASCII码相互转换
2018-09-12 14:32 10245public class stringToAscii { p ... -
java根据url下载附件源码
2017-04-18 10:37 690public static void runDownLoad( ... -
解决553 authentication is required 错误
2017-04-12 09:46 3487//获取系统属性 Properties pro = Sys ... -
java序列化和反序列化 以及transient的含义
2017-04-11 15:31 664=============================== ... -
ajax跨源解决办法(jsonp)
2017-04-11 10:39 440<!DOCTYPE html PUBLIC " ... -
socket知识
2017-04-11 10:29 447网络应用: socket java: socket类 1. ... -
URL的常用方法和获取网页数据实例
2017-04-10 11:23 587=============================== ... -
tomcat发布Java项目的两种方式
2017-04-06 15:19 339部署tomcat项目有两种方式: 方法一是在eclipse中启 ... -
HashSet,TreeSet和LinkedHashSet的区别
2017-04-06 10:10 386原文:http://www.cnblogs.com ... -
java中map排序(SortedMap的用法)
2017-04-06 09:47 2050package JavaSenior; import jav ... -
java遍历list和map集合
2017-04-06 09:18 1255package JavaSenior; import jav ... -
java模拟浏览器抓取网站信息和下载附件
2017-03-30 09:46 1567package com.teamdev.jxbrowser.c ... -
window_根据进程号关闭进程
2017-03-29 11:22 535netstat -ano | findstr 80 //列出进 ... -
java代码关闭指定进程
2017-03-28 17:07 1217//window下 public static void m ... -
eclipse配置webservice
2017-03-28 14:19 508引用:http://www.cnblogs.com/xwdre ... -
java遍历list和map的几种方式
2017-03-24 17:06 985package JavaSenior; import jav ... -
java多态的优点和存在的必要条件
2017-03-24 14:46 1326/** 多态的优点: 1. 消除类型之间的耦合关系 ... -
java 目录创建,遍历与删除
2017-03-24 10:56 498package JavaAdvanced; import j ... -
java输入输出流
2017-03-24 10:15 616package JavaAdvanced; //Java 流( ... -
java中二维数组的赋值与遍历
2017-03-23 16:54 2652//创建多维数组 int [][] IntAy=new i ...
相关推荐
本文将详细介绍如何在Eclipse中使用wsdl文件生成Java客户端。 首先,让我们了解什么是wsdl文件。Wsdl(Web Services Description Language)是一种基于XML的语言,用于描述Web服务的接口。它提供了关于Web服务的...
到plugin xml文件中 保存后重新启动Eclipse即可 ">1 下载 Myeclipse Axis2 插件 http: archive apache org dist ws axis2 tools 1 4 1 下载 axis2 eclipse codegen wizard zip 和 axis2 eclipse service ...
AXIS2 最新版本1.7.3针对 eclipse插件,一方面可以根据java接口类生成WSDL文件,另一方面可以根据WSDL生成客户端或服务端代码,生成的WSDL文件和代码符合web server SOAP协议规范标准!解压后的jar复制到Eclipse的...
axis2支持webservice 自动生成代码客户端服务端代码 基于eclipse
第三种方式是利用axis2插件,将wsdl文件自动生成客户端代码,此种方式在myeclipse安装axis2.txt文件中已经做了详细介绍。 备注:资源超过了70M 分成了2部分 见axis2方式开发webservice(一)和 axis2方式开发...
axis2的eclispe插件分为2个,一个是帮助我们生成aar文件的,另一个是帮我们用wsdl文件生成stub代码的 官网下载地址是: ...
第三种方式是利用axis2插件,将wsdl文件自动生成客户端代码,此种方式在myeclipse安装axis2.txt文件中已经做了详细介绍。 备注:资源超过了70M 分成了3部分 见axis2方式开发webservice(一)和 axis2方式开发...
Eclipse的Axis插件,用来生成Web Service WSDL 服务端客户端代码
下载完2个压缩文件后,可以直接把解压后的文件拷贝到plugins目录中,也可以在links目录中写文件路径的方式来安装插件,安装完插件后,打开eclipse,在package explorer 中点击右键--->选择new---->other中看到axis ...
第三种方式是利用axis2插件,将wsdl文件自动生成客户端代码,此种方式在myeclipse安装axis2.txt文件中已经做了详细介绍。 备注:资源超过了70M 分成了3部分 见axis2方式开发webservice(一)和 axis2方式开发...
eclipse 工具通过axis2插件,根据wsdl生成webservice客户端代码。将此文件解压缩,放到%eclipse_home%\eclipse\plugins中,重启eclipse。然后选中项目,新建-other-axis2 wizards 下的axis2 code generate ,然后...
WebService Axis2框架根据java class 生成wsdl文件的插件,解压后把文件放到eclipse安装目录的plugins文件夹下就行,具体使用可以看我的博客
eclipse的在编写webservice时生成wsdl的插件
axis2帮助用wsdl文件生成stub代码的eclipse插件
新版的Eclipse可能不完全向下兼容Axis2插件(太旧版的Axis2插件)。 网上博客的文章很多存在一些小错误。 细节问题没做好。 现在我把自己的操作成功的实例重新演练一遍,基本跟大家啊网上参考的一致,请注意every ...
java webservice 开发用来生成wsdl的插件,整合到eclipse里面
Axis2 插件提供了许多有用的功能,例如生成 WSDL 文件、生成服务端点、生成客户端代码等。 三、实验设备和环境要求 实验设备和环境要求包括: * PC 机最低配置:2GHz 以上 CPU; 1G 以上内存;1G 自由硬盘空间 * ...