使用脚本、AXIS发布 webservice
时间:2010-07-17 来源:wang-haha
1、修改web.xml加入Axis servlet
2、部署服务
使用两个文件:deploy.bat、deploy.wsdd
deploy.wsdd:
deploy.bat:
3、取消部署
使用两个文件:undeploy.bat、undeploy.wsdd
undeploy.wsdd:
undeploy.bat:
4、WSDL2Java
使用两个文件:SayHello.wsdl、WSDL2Java.bat
WSDL2Java.bat:
<servlet> <servlet-name>Axis Servlet</servlet-name> <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Axis Servlet</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping>
2、部署服务
使用两个文件:deploy.bat、deploy.wsdd
deploy.wsdd:
<?xml version="1.0" encoding="UTF-8"?> <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <service name="SayHello" provider="java:RPC"> <parameter name="className" value="com.SayHello"/> <parameter name="allowedMethods" value="*"/> </service> </deployment>
deploy.bat:
set Axis_Lib=F:\java\lib\axis-1_4\lib set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib% set Axis_Servlet=http://localhost:8080/webservice_test/services %Java_Cmd% org.apache.axis.client.AdminClient -l%Axis_Servlet% deploy.wsdd
3、取消部署
使用两个文件:undeploy.bat、undeploy.wsdd
undeploy.wsdd:
<?xml version="1.0" encoding="UTF-8"?> <undeployment xmlns="http://xml.apache.org/axis/wsdd/"> <service name="SayHello"/> </undeployment>
undeploy.bat:
set Axis_Lib=F:\java\lib\axis-1_4\lib set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib% set Axis_Servlet=http://localhost:8080/webservice_test/services %Java_Cmd% org.apache.axis.client.AdminClient -l%Axis_Servlet% undeploy.wsdd
4、WSDL2Java
使用两个文件:SayHello.wsdl、WSDL2Java.bat
WSDL2Java.bat:
set Axis_Lib=F:\java\lib\axis-1_4\lib set Java_Cmd=java -Djava.ext.dirs=%Axis_Lib% set Output_Path=F:\ set Package=test.sayHello %Java_cmd% org.apache.axis.wsdl.WSDL2Java -o%Output_Path% -p%Package% SayHello.wsdl
相关阅读 更多 +