亚洲免费在线-亚洲免费在线播放-亚洲免费在线观看-亚洲免费在线观看视频-亚洲免费在线看-亚洲免费在线视频

Axis開發經驗集(How to use Axis)

系統 2378 0
  • Axis是什么(What is Axis)

Axis is essentially a SOAP engine,The current version of Axis is written in Java, but a C++ implementation of the client side of Axis is being developed.

Axis本質上是一個SOAP引擎,目前的Axis是用java編寫的,同時Axis還有一個C++版本(關于C++版本的Axis這里不做介紹,有興趣的朋友可以自己去研究)。

for a detailed information about what axis is,please visit the official site of axis
http://ws.apache.org/axis/java/user-guide.html

如果需要了解更多的Axis信息,請訪問Axis的官方網站
http://ws.apache.org/axis/java/user-guide.html

  • SOAP是什么(What is SOAP)



SOAP stands for Simple Object Access Protocol
SOAP is a communication protocol
SOAP is for communication between applications
SOAP is a format for sending messages
SOAP communicates via Internet
SOAP is platform independent
SOAP is language independent
SOAP is based on XML
SOAP is simple and extensible
SOAP allows you to get around firewalls
SOAP is a W3C recommendation


SOAP代表簡單對象訪問協議
SOAP是一種通信協議
SOAP用于在應用程序之間的通信
SOAP是一種用于發送消息的格式
SOAP 被設計用來通過因特網進行通信
SOAP 獨立于平臺
SOAP 獨立于程序語言
SOAP 基于 XML
SOAP 很簡單并可擴展
SOAP 允許您繞過防火墻
SOAP 將被作為 W3C 標準來發展


  • 如何安裝Axis(How to install Axis in Web Application)


1.準備WEB服務器(Preparing an application server)

First of all,you should have an application server or servlet engine and be familiar with operating and deploying to it. and i prefered Jakarta Tomcat which is also Axis's official site( http://ws.apache.org/axis/java/ )'s recommendation


首先,你需要擁有一個WEB服務器或者Servlet引擎,而且熟悉它的操作和部署。我更喜歡Tomcat(感覺它是國內大多數Java開發者學習J2EE應用的入門級服務器,簡單而實用)。


2.準備WEB應用程序(Preparing the webapp)


Here I assume that you have a web server up and running on the localhost at port 8080. If your server is on a different port,never mind.

這里我假設你已經有了一個已經啟動的WEB服務器,端口號為8080。如果你的端口號不同也沒關系。

Note:webapp refers to web application here.

備注:webapp在這里指的是web應用程序


my webapp is christened "myaxis" here which is alreay deployed in Tomcat.(the detail of how to deploy webapp in Tomcat will not be metioned here)

我將我的web應用程序命名為"myaxis",并且該web程序已經在Tomcat中部署。(關于如何在Tomcat中部署web應用程序,這里不會提及)


3、加入必須的jar文件(Setting up the required jar files)


there are a couple of jar files(listed below) needs to be added in your own webapp's lib folder(let's assume the lib folder of "myaxis" is "wwwroot\WEB-INF\lib")

如果想在你自己的應用程序中使用axis,必須要將下面列表中列出的jar文件加入到你的應用程序的lib目錄下(假設"myaxis"的lib目錄為"wwwroot\WEB-INF\lib")

AXIS必須的jar文件列表(AXIS REQUIRED JAR FILES LIST)
axis.jar
axis-ant.jar
commons-discovery*.jar
commons-logging*.jar
jaxrpc.jar
saaj.jar
wsdl4j*.jar

Note:lib folder refers to libararies folder here.
Note:* is a placeholader that substitutes the real version of jar file which depends on the version of axis.for example,Axis 1.4 uses commons-discovery-0.2.jar,commons-logging-1.0.4.jar.

備注:lib目錄在這里指libararies目錄。
備注:*代表占位符,代替該jar文件的真實版本號,因為axis的版本不同,它使用的jar文件就有可能不同。


4、設置web.xml(Setting up the web.xml)

(將以下內容加入你自己的web.xml)Add following text to your own web.xml

<servlet>
??? <servlet-name>AxisServlet</servlet-name>
??? <display-name>Apache-Axis Servlet</display-name>
??? <servlet-class>
??????? org.apache.axis.transport.http.AxisServlet
??? </servlet-class>
? </servlet>

? <servlet>
??? <servlet-name>AdminServlet</servlet-name>
??? <display-name>Axis Admin Servlet</display-name>
??? <servlet-class>
??????? org.apache.axis.transport.http.AdminServlet
??? </servlet-class>
??? <load-on-startup>100</load-on-startup>
? </servlet>

? <servlet>
??? <servlet-name>SOAPMonitorService</servlet-name>
??? <display-name>SOAPMonitorService</display-name>
??? <servlet-class>
??????? org.apache.axis.monitor.SOAPMonitorService
??? </servlet-class>
??? <init-param>
????? <param-name>SOAPMonitorPort</param-name>
????? <param-value>5001</param-value>
??? </init-param>
??? <load-on-startup>100</load-on-startup>
? </servlet>

? <servlet-mapping>
??? <servlet-name>AxisServlet</servlet-name>
??? <url-pattern>/servlet/AxisServlet</url-pattern>
? </servlet-mapping>

? <servlet-mapping>
??? <servlet-name>AxisServlet</servlet-name>
??? <url-pattern>*.jws</url-pattern>
? </servlet-mapping>

? <servlet-mapping>
??? <servlet-name>AxisServlet</servlet-name>
??? <url-pattern>/services/*</url-pattern>
? </servlet-mapping>

? <servlet-mapping>
??? <servlet-name>SOAPMonitorService</servlet-name>
??? <url-pattern>/SOAPMonitor</url-pattern>
? </servlet-mapping>

<!-- uncomment this if you want the admin servlet -->
<!--
? <servlet-mapping>
??? <servlet-name>AdminServlet</servlet-name>
??? <url-pattern>/servlet/AdminServlet</url-pattern>
? </servlet-mapping>
-->

??? <session-config>
??????? <!-- Default to 5 minute session timeouts -->
??????? <session-timeout>5</session-timeout>
??? </session-config>

??? <!-- currently the W3C havent settled on a media type for WSDL;
??? http://www.w3.org/TR/2003/WD-wsdl12-20030303/#ietf-draft
??? for now we go with the basic 'it's XML' response -->
? <mime-mapping>
??? <extension>wsdl</extension>
???? <mime-type>text/xml</mime-type>
? </mime-mapping>
?

? <mime-mapping>
??? <extension>xsd</extension>
??? <mime-type>text/xml</mime-type>
? </mime-mapping>



4、啟動WEB服務器(Starting the web server)


5、驗證Axis部署是否成功(Validate the Installation)

Navigate to http://127.0.0.1:8080/myaxis/servlet/AxisServlet,
though of course the port and the address may differ.

訪問地址http://127.0.0.1:8080/myaxis/servlet/AxisServlet,
當然你的web應用程序的端口或者地址可能不同。

You should now see an page as follows.
If you do not, then the webapp is not actually installed, or the appserver is not running.

你應該可以看到下面的頁面。
如果你沒有看到下面的這個頁面,你的web應用程序可能還沒部署,或者你的web服務器沒有運行。




  • Axis在真實項目中的應用(Axis in real application)


服務發布方和服務調用方的定義
(The definition of the service publisher and the service invoker)

if the SOAP service(webservice also) which was being deployed in your webapp
(in real world,perhaps the project which your team developed)
by axis should be invoked by an external webapp
(in real world,perhaps the project which was already being published by another corp),
or probably by a couple of outer webapps.we call your webapp the service publisher,
consequently the external webapp is the service invoker.


如果你的WEB服務中(在現實中,指你開發的系統)
用axis部署的SOAP服務(或者稱為WEBSERVICE服務)被外部的WEB服務
(在現實中,可能是別的廠家開發的系統)調用,
那么我們稱你的WEB服務為服務發布方,相應地,外部WEB服務為服務調用方。


1、(作為服務發布方)The service publisher side

作為服務的發布方,首先需要做的是擁有一個SOAP服務,
下面將詳細介紹如何用axis發布一個SOAP服務

(1)寫一個Java類,在該類中寫一個Java方法,我們的Java類名為:HalloAxis.java
public class HalloAxis {
???? public int addition(int num1,int num2)
???? {
??? return num1 + num2;
???? }
}

(2)寫一個deploy.wsdd

(3)寫一個windows批處理命令(假設你的操作系統是windows)
我們的批處理命令文件名為:deploy.bat
set axislib = 你的lib目錄的路徑(比如 D:/myaxis/wwwroot/WEB-INF/lib)
set classpath=.;%axislib%\axis.jar;%axislib%\axis-ant.jar;
??????????????? %axislib%\saaj.jar;%axislib%\commons-discovery*.jar;
??????????????? %axislib%\jaxrpc.jar;%axislib%\commons-logging*.jar;
java org.apache.axis.client.AdminClient -l http://localhost:8080/myaxis/servlet/AxisServlet 你的deploy.wsdd的路徑
pause







Axis開發經驗集(How to use Axis)


更多文章、技術交流、商務合作、聯系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦?。。?/p>

發表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 在线观看中文字幕一区 | 99久久国产亚洲综合精品 | 欧美成人亚洲 | 在线婷婷 | 亚洲精品一区二区三区婷婷月 | 亚洲香蕉久久一区二区三区四区 | 亚洲国产精品久久久久网站 | 日本欧美一区二区三区乱码 | 中文字幕一区二区三区免费看 | 亚洲精品国产一区二区三 | 日日摸日日碰夜夜爽久久 | 亚洲图片另类 | 亚洲欧美另类日韩 | www.久久在线 | 亚洲国产高清视频在线观看 | 一本久道久久综合中文字幕 | 亚洲小视频在线播放 | 久久精品国产视频在热 | 亚洲欧美日本一区 | 天天摸天天干天天操 | 亚洲天码中文字幕第一页 | 欧美成人性毛片免费版 | 美女久久 | 91久久国产精品 | 欧美日韩国产亚洲一区二区 | 亚洲 另类色区 欧美日韩 | 欧美在线成人免费国产 | 精品哟哟国产在线观看 | 奇米狠狠 | 亚洲久久 | 大色综合色综合资源站 | a国产精品| 久久人视频 | 99这里只有精品视频 | 日韩精品中文字幕一区二区三区 | 成人精品国产 | 国产中文字幕第一页 | 女人牲交视频一级毛片 | 亚洲天堂爱爱 | 很很操很很日 | 91免费福利视频 |