作者:徐建祥(netpirate@gmail.com)
時間:
soap 應用結構圖:
1、安裝App Server
???? Tomcat/JRun...
2、安裝/解壓Axis組件/包
???? Tomcat:將Axis解壓到webapps下
???? JRun:將Axis隨便解壓到某個目錄下,然后將Axis發布成Server的一個Web Application
3、http://localhost:8080/axis/?可以正常訪問了吧
?? http://localhost:8080/axis/services/?發現少了幾個包?按照提示到google上搜了下載,^_^
jaf-1_0_2.zip
See http://java.sun.com/products/javabeans/glasgow/jaf.html
javamail1_1_3.zip
See http://xml.apache.org/security/
jaxrpc.jar and saaj.jar 。。。 。。。
See http://java.sun.com/products/javabeans/glasgow/jaf.html
javamail1_1_3.zip
See http://xml.apache.org/security/
jaxrpc.jar and saaj.jar 。。。 。。。
4、在Axis上添加個Service
a. {Axis}/WEB-INF/deploy.wsdd:
a. {Axis}/WEB-INF/deploy.wsdd:






b. {Axis}/WEB-INF/server-config.wsdd
<service?name="PhoenixService"?provider="java:RPC">
??<parameter?name="allowedMethods"?value="*"/>
??<parameter?name="className"?value="com.newpalm.phoenixservice.PhoenixService"/>
?</service>c. 訪問http://localhost:8080/axis/services/PhoenixService?wsdl,看到什么了,嗬嗬
5、如果PhoenixService.java中有個簡單的hello方法,返回一個字串




5、如果PhoenixService.java中有個簡單的hello方法,返回一個字串
嗬嗬,這時候就需要創建一個SOAP Client測試用了
6、使用JBuilder9創建SOAP Client:
new->web services->import a web service
輸入上面的wsdl地址,一路next即可。看看PhoenixServiceServiceTestCase.java的main方法。
(注,以PhoenixService為例)
7、可能你準備傳輸的是一個對象,這時候就要用到新的配置和對象序列化(implements java.io.Serializable),如:
?













8、SOAP數據接口搞定!