【发布时间】:2023-04-04 23:44:01
【问题描述】:
我从 wsdl 开发了一个 .net Web 服务。预期的肥皂输入具有肥皂正文(取自浏览器)为
<soap:Body>
<InsertRequest xmlns="http://www.xyz.com/MainType/">
<InsertRequest>
<context xmlns="">
...
</context>
<request xmlns="">
...
</request>
</InsertRequest>
</InsertRequest>
</soap:Body>
我的客户正在发送一个带有肥皂主体的肥皂请求,如下所示
<soap:Body>
<InsertRequest xmlns="http://www.xyz.com/MainType/">
<InsertRequest xmlns="">
<context>
...
</context>
<request>
...
</request>
</InsertRequest>
</InsertRequest>
</soap:Body>
我编写了一个虚拟应用程序,它对 .net 网络服务进行 HttpWebRequest 调用。如果我通过具有如下肥皂体的肥皂信封,它就可以工作
<soap:Body>
<InsertRequest xmlns="http://www.xyz.com/MainType/">
<InsertRequest>
<context xmlns="">
...
</context>
<request xmlns="">
...
</request>
</InsertRequest>
</InsertRequest>
</soap:Body>
但是我的客户给了他们寄来的肥皂信封,它的肥皂盒是
<soap:Body>
<InsertRequest xmlns="http://www.xyz.com/MainType/">
<InsertRequest xmlns="">
<context>
...
</context>
<request>
...
</request>
</InsertRequest>
</InsertRequest>
</soap:Body>
当我在虚拟应用程序中使用这个肥皂体时,我的 web 方法 InsertRequest(InsertRequest insertRequest) 中的参数值为 NULL。 任何人都可以让我知道为什么在上述肥皂体的情况下参数会获得 NULL 值吗?另外,为什么两个肥皂消息之间的肥皂正文的 xmlns='' 出现不同?
提前致谢, 哈里什
【问题讨论】: