2012-04-07 71 views
2

我有和android客戶端,它使用kso​​ap與用c#asp.net編寫的wsdl web服務進行通信。我在Web服務和客戶端之間匹配參數類型時遇到了問題。 Web服務器預計這種要求(自動生成):肥皂web服務和android客戶端使用kso​​ap協議不匹配

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body> 
    <GetDetails xmlns="http://host.org/"> 
     <event_id>int</event_id> 
    </GetDetails> 
    </soap:Body> 
</soap:Envelope> 

客戶端使用KSOAP發送請求,他們是這樣的:

<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/"> 
    <v:Header /> 
     <v:Body> 
      <n0:GetDetails id="o0" c:root="1" xmlns:n0="http://tempuri.org"> 
       <event_id i:type="d:int">1</event_id> 
      </n0:GetDetails> 
     </v:Body> 
</v:Envelope> 

出於某種原因,WS分析如下'客戶端的請求爲0(我猜是因爲附加的類型屬性 - 我:type =「d:int」),當請求被手動組裝起來看起來像第一個選項時,它可以正常工作。 如何使Web服務正確讀取ksoap格式,或者如何將其預期格式更改爲ksoap請求。 (web服務soap協議是自動生成的)。

回答

相關問題