Home >Database >Mysql Tutorial >axis2的wsdl无法使用eclipse axis1插件来生成客户端

axis2的wsdl无法使用eclipse axis1插件来生成客户端

WBOY
WBOYOriginal
2016-06-07 15:00:551119browse

使用jettyaxis2实现webservice服务端,且无需使用axis2命令生成服务端代码,只要services.xml配置实现类。 工程为gradle工程配置文件在src/main/resources/axis2/WEB-INF/services.xml: ?xml version=1.0 encoding=UTF-8?serviceGroupservice name=wifiecSe

使用jetty+axis2实现webservice服务端,且无需使用axis2命令生成服务端代码,只要services.xml配置实现类。

工程为gradle工程配置文件在src/main/resources/axis2/WEB-INF/services.xml:

<?xml version="1.0" encoding="UTF-8"?>
<servicegroup>
	<service name="wifiecService">
		<description>
			Please Type your service description here
		</description>
		<messagereceivers>
			<messagereceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"></messagereceiver>
		</messagereceivers>
		<parameter name="ServiceClass" locked="false">com.smsservice.webservices.SmsService
		</parameter>
	</service>
</servicegroup>

浏览器访问服务端wsdl地址,保存下来的wsdl文件无法通过eclipse luna自带的axis1插件生成客户端代码,缺少一个xxxPortType类,

解决方法:使用axis1的wsdl2java命令来生成客户端代码:

脚本:wsdl2java.bat

set Axis_Lib=G:\jar-lib\axis1.4
set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib%
set Output_Path=C:\Users\tower\Desktop\test
set Package=wcf
%Java_Cmd% org.apache.axis.wsdl.WSDL2Java http://x.x.x.x:9002/services/xxxService?wsdl -o%Output_Path% -p%Package%

dos下执行此脚本,会生成服务端代码和客户端代码到test目录。


G:\jar-lib\axis1.4 的目录
2007-10-17  11:05            56,290 activation.jar
2006-04-22  18:56            33,202 axis-ant.jar
2006-04-22  18:56         1,599,570 axis.jar
2006-04-22  18:56            71,442 commons-discovery-0.2.jar
2006-04-22  18:56            38,015 commons-logging-1.0.4.jar
2006-04-22  18:56            31,191 jaxrpc.jar
2011-06-02  16:30           391,834 log4j-1.2.15.jar
2006-04-22  18:56               921 log4j.properties
2009-08-02  15:04           436,053 mail.jar
2006-04-22  18:56            18,979 saaj.jar
2006-04-22  18:56           126,771 wsdl4j-1.5.1.jar




Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn