【正文】
tch (AxisFault axisFault) {()。INONLYtry {OMElement payload = ()。(targetEPR)。(options)。/**We have to block this thread untill we send the request , the problemis if we go out of the*main thread , then request wont send ,so you have to wait some time :) */(500)。}EchoBlockingClient將第一段代碼的調(diào)用代碼改為具體的例子在中Axiscallbackpublic abstract void onError(Exception e)。EchoNonBlockingDualClienttry {OMElement payload = ()。(targetEPR)。(true)。}public void onError(Exception e) {()。//NonBlocking Invocationsender = new ServiceClient()。(options)。//Wait till the callback receives the response.while (!()) {(1000)。} catch (Exception ex) {()。} catch (AxisFault axisFault) {//have to ignore this}}ServerAddressingAddressing ModuleHandlers”predispatch”/webapps/axis2/WEBINF客戶端支持的方式,一種是將放在中,另一種就是根據(jù)給定的庫位置創(chuàng)建一個sender = new ServiceClient()。之前加上ConfigurationContext configContext = ( Axis2RepositoryLocation , null)。sender = new ServiceClient()。改為Axis2Home/samples/userguide/src/userguide/clients/相似,在這種情況下不再需要來處理這個機制非常適用于處理類型的調(diào)用,而傳輸協(xié)議卻是的情況。中的來測試Module構(gòu)造和部署分為以下幾個步驟:a.Module創(chuàng)建創(chuàng)建修改(如果你需要定制的語句)e.AxisModulesf.在中部署這些現(xiàn)在來創(chuàng)建一個簡單的這個包含一個它的作用就是紀錄通過它的消息。通過來部署下圖就是這個部署包的結(jié)構(gòu)創(chuàng)建是的實現(xiàn),它必須實現(xiàn)接口:創(chuàng)建的一個可以包含一個或者多個這些將處理頭文件中的不同一個必須實現(xiàn)接口,或者通過另一種簡單方式,public QName getName() { public void invoke(MessageContext msgContext) throws AxisFault { public void setName(QName name) {Step 3: 這個文件包含了一個特定的部署配置。a. Represents the handler chain that will run when a message is ing in.b. Represents the handler chain that will run when the message is going out.c.INfaultflow describes the phase in which this handler runs.修改”loggingPhase”predefined handler phasemodule于是引擎就可以知道在不同的中如何放那些這些增加是在的部分,在標志了 user can add his own phases to this area之后加入這樣,這個將在引擎的任何消息流中調(diào)用修改logging modulemodule在該文件中加上了Step 6:jarrarmarStep 7:Axis2Module首先要在目錄下創(chuàng)建一個文件夾,然后將文件放在這個文件夾中,然后重啟并運行服務(wù)進行測試Google Spell Checker, Google Search,Amazon Queuing Service160