axis 接口开发

用Axis开发webservice接口简略:

 

1. Generate server-config.wsdd

 

2. Config web.xml

<servlet>
     <servlet-name>AxisServlet</servlet-name>
     <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
</servlet>
<servlet-mapping>
     <servlet-name>AxisServlet</servlet-name>
     <url-pattern>/services/*</url-pattern>
</servlet-mapping>

3. Develop interface

 

4. JavaToWsdl

 

java -cp .\lib\axis.jar;.\lib\jaxrpc.jar;.\lib\saaj.jar;.\lib\wsdl4j-1.5.1.jar;.\lib\commons-discovery-0.2.jar;.\lib\commons-logging-1.0.4.jar;.\classes org.apache.axis.wsdl.Java2WSDL  --style DOCUMENT --use LITERAL --PkgtoNS com.zlz.ws=namespace -l "http://localhost:8080/test" -o common.wsdl  com.zlz.ws.Test

 

5. Deploy wsdd

 

java -cp .\lib\axis.jar;.\lib\jaxrpc.jar;.\lib\saaj.jar;.\lib\wsdl4j-1.5.1.jar;.\lib\commons-discovery-0.2.jar;.\lib\commons-logging-1.0.4.jar;.\classes org.apache.axis.client.AdminClient -1http://localhost:8080/test/webservice/common?wsdl deploy.wsdd

 

6. UnDeploy wsdd

 

java -cp .\lib\axis.jar;.\lib\jaxrpc.jar;.\lib\saaj.jar;.\lib\wsdl4j-1.5.1.jar;.\lib\commons-discovery-0.2.jar;.\lib\commons-logging-1.0.4.jar;.\classes org.apache.axis.client.AdminClient -1http://localhost:8080/test/webservic/e/common?wsdl undeploy.wsdd

 

7. Generate server side code

 

java -cp .\lib\axis.jar;.\lib\jaxrpc.jar;.\lib\saaj.jar;.\lib\wsdl4j-1.5.1.jar;.\lib\commons-discovery-0.2.jar;.\lib\commons-logging-1.0.4.jar;.\classes org.apache.axis.wsdl.WSDL2Java  common.wsdl   -t --server-side --skeletonDeploy true  -p   com.zlz.Test

 

8. Generate client side code

 

java -cp .\lib\axis.jar;.\lib\jaxrpc.jar;.\lib\saaj.jar;.\lib\wsdl4j-1.5.1.jar;.\lib\commons-discovery-0.2.jar;.\lib\commons-logging-1.0.4.jar;.\classes org.apache.axis.wsdl.WSDL2Java  common.wsdl   -t --skeletonDeploy true  -p   com.zlz.Test

 

今天先写到这,改天有空再修改完善。

你可能感兴趣的:(apache,xml,Web,webservice,servlet)