在Eclipse中使用Axis2插件自动生成WSDL文件
发布日期:2021-10-03 01:52:02
浏览次数:16
分类:技术文章
本文共 4020 字,大约阅读时间需要 13 分钟。
原文: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>转载地址:https://blog.csdn.net/kai402458953/article/details/88340427 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!
发表评论
最新留言
第一次来,支持一个
[***.219.124.196]2024年03月23日 23时22分47秒
关于作者
喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
05 Python之条件与循环
2019-04-26
06 Python之函数调用与定义
2019-04-26
07 Python之Numpy库
2019-04-26
08 Python之Pandas库选择查看、选择
2019-04-26
09 Python之Pandas库之数据处理与规整
2019-04-26
卷积神经网络交通标志识别
2019-04-26
【实战】深度学习构建人脸面部表情识别系统
2019-04-26
Python机器学习&数据分析-关联规则
2019-04-26
【实战】kaggle猫狗大战-卷积神经网络实现猫狗识别
2019-04-26
01 计算机视觉-opencv图像基本操作
2019-04-26
02 计算机视觉-opencv阈值与滤波处理
2019-04-26
03 计算机视觉-opencv图像形态学处理
2019-04-26
04计算机视觉-opencv图像梯度处理
2019-04-26
05计算机视觉-opencv边缘检测
2019-04-26
如何在junit中使用SpringFramework的Ioc容器
2019-04-26
一个案例教你理解Spring面向切面编程(Spring Aop)
2019-04-26
手把手教你整合SSM框架
2019-04-26
自己造个简单数据校验的注解@Value和@Mail
2019-04-26
Poj百练 4148:生理周期 (分类:枚举)
2019-04-26
Java如何读写注册表
2019-04-26