具有多个名称空间的SOAP调用

时间:2012-02-08 15:20:28

标签: c# .net web-services soap

我对网络服务的一些调用有问题:

当我创建SoapEnveloper时,我把它放在电线上

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
   <soapenv:Header/>
   <soapenv:Body>
      <tem:GetUserIDByName>
      <tem:sUser>sample</tem:sUser>
         <tem:oParam>
            <tem:CountryURL>US</tem:CountryURL>
            <tem:noCache>false</tem:noCache>
         </tem:oParam>
      </tem:GetUserIDByName>
   </soapenv:Body>
</soapenv:Envelope>

但回应如下:

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsa="http://www.w3.org/2005/08/addressing">
   <env:Header>
      <wsa:MessageID>urn:16092960528611E1BFADB7181697B03B</wsa:MessageID>
      <wsa:ReplyTo>
         <wsa:Address>http://www.w3.org/2005/08/addressing/anonymous</wsa:Address>
         <wsa:ReferenceParameters>
            <instra:tracking.ecid xmlns:instra="http://xmlns.oracle.com/sca/tracking/1.0">0000JLUJsMq0VsSqyCBh6G1FCdSn000GYf</instra:tracking.ecid>
         </wsa:ReferenceParameters>
      </wsa:ReplyTo>
   </env:Header>
   <env:Body>
      <GetUserIDByNameResponse xmlns="http://tempuri.org/">
         <Error>
            <ErrorCode>0</ErrorCode>
            <ErrorMessage>''</ErrorMessage>
         </Error>
         <ReturnValue>0</ReturnValue>
         <GetUserIDByNameResult>9815</GetUserIDByNameResult>
      </GetUserIDByNameResponse>
   </env:Body>
</env:Envelope>

现在,此服务调用的自动生成的代理类具有以下属性:

[SoapDocumentMethodAttribute("http://tempuri.org//GetUserNameById", 
    RequestNamespace="http://tempuri.org/", 
    ResponseNamespace="http://tempuri.org/", 
    Use=System.Web.Services.Description.SoapBindingUse.Literal, 
    ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

对应于默认命名空间。

问题似乎是反序列化过程似乎不理解响应。

有关如何解决这个问题的想法吗?

0 个答案:

没有答案