2011-09-09 116 views
2

我有Axis 1客戶端的Axis 1 Web服務。一切工作都很好,我從Web服務獲得的數據是正確的。現在,需要將Web服務移動到使用Axis 2,我有問題需要獲取有關Axis 1客戶端的數據。我使用SOAPUI來查看我得到的響應格式。Axis 2 Web服務不兼容的Axis 1客戶端

隨着軸1 Web服務的響應如下:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> 
    <soapenv:Body> 
     <getInventoryResponse xmlns="http://webservices.com"> 
     <getInventory> 
      <errorCode>10071</errorCode> 
      <inventory xsi:nil="true"/> 
     </getLastInventoryCountReturn> 
     </getInventoryResponse> 
    </soapenv:Body> 
</soapenv:Envelope> 

與軸線2 web服務,響應如下:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soapenv:Body> 
     <ns:getInventoryResponse xmlns:ns="http://webservices.com"> 
     <ns:return xsi:type="ax21:Inventory" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ax21="http://model.com/xsd"> 
      <ax21:errorCode>10071</ax21:errorCode> 
      <ax21:inventory xsi:nil="true"/> 
     </ns:return> 
     </ns:getInventoryResponse> 
    </soapenv:Body> 
</soapenv:Envelope> 

正如你所看到的,名爲「errorCode」的元素的值爲10071.我從兩個Web服務在客戶端上正確接收errorCode值。但我有一個稱爲「庫存」的複雜類型,作爲響應的一部分(它沒有出現在上面包含的響應中,因爲我需要一些時間才能在Web服務上填充相應的數據)。 InventoryItem包含不同數據類型的字段(字符串,日曆)。我注意到,來自Axis 2 Web服務的響應包含<axs21> xml標籤,而在Axis 1 Web服務中,它不在那裏。所以我假設我在客戶端有一個解析問題,並且來自Axis 2 Web服務的響應。

有誰知道我該如何解決這個問題?

+0

與Axis2生成的wsdl有什麼不兼容? Axis2默認生成文檔/點亮類型wsdl。這應該適用於任何肥皂框架工作。 –

+1

我編輯了我的帖子以更好地描述問題。請檢查它並讓我知道你的想法。 –

+0

你是什麼意思,我**假設**我有問題?這似乎是一個問題,但你還沒有測試過? –

回答

1

所以顯然我做錯了什麼。將Web服務從Axis 1移動到Axis2時,我必須重新創建我的客戶端代碼

相關問題