2011-03-17 61 views
0

我已经开发了一个wsdl的.net webservice。预期皂输入具有皂体(从浏览器获取)作为webmethod的参数值有空值

<soap:Body> 
    <InsertRequest xmlns="http://www.xyz.com/MainType/"> 
     <InsertRequest> 
     <context xmlns=""> 
      ... 
     </context> 
     <request xmlns=""> 
      ... 
     </request> 
     </InsertRequest> 
    </InsertRequest> 
    </soap:Body> 

我的客户发送用肥皂身体SOAP请求像下面

<soap:Body> 
    <InsertRequest xmlns="http://www.xyz.com/MainType/"> 
     <InsertRequest xmlns=""> 
     <context> 
      ... 
     </context> 
     <request> 
      ... 
     </request> 
     </InsertRequest> 
    </InsertRequest> 
    </soap:Body> 

我写了一个虚拟的应用程序,使得HttpWebRequest的通话到.net web服务。在,如果我通过了有SOAP信封肥皂身体下面,它的工作原理

<soap:Body> 
    <InsertRequest xmlns="http://www.xyz.com/MainType/"> 
     <InsertRequest> 
     <context xmlns=""> 
      ... 
     </context> 
     <request xmlns=""> 
      ... 
     </request> 
     </InsertRequest> 
    </InsertRequest> 
    </soap:Body> 

但我的客户给了SOAP信封,他们发送和它的肥皂身体

<soap:Body> 
    <InsertRequest xmlns="http://www.xyz.com/MainType/"> 
     <InsertRequest xmlns=""> 
     <context> 
      ... 
     </context> 
     <request> 
      ... 
     </request> 
     </InsertRequest> 
    </InsertRequest> 
    </soap:Body> 

当我使用这个soap应用程序中的body,我的webmethod中的参数值InsertRequest(InsertRequest insertRequest)为NULL。 任何人都可以让我知道为什么参数获得上述肥皂体的NULL值吗?另外,为什么soap消息中的肥皂体的xmlns ='发生差异?

由于提前, 哈里什

回答

0

空参数通常指示传入SOAP无法序列的类型。

当您从WSDL创建服务时,您是通过手动执行还是使用工具?

尝试从使用这个工具的WSDL创建服务存根: http://www.thinktecture.com/resourcearchive/tools-and-software/wscf ,看看是否有您实现数据合同/框架类的任何差异。然后,您可以将实现代码放入框架中,并尝试使用提供的SOAP XML调用它以测试互操作性。