2012-04-07 121 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协议是自动生成的)。

回答