【发布时间】:2009-03-05 10:01:23
【问题描述】:
我们正在向 .Net 3.5 ASMX Web 服务发送以下请求。
<SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<Login xmlns="http://tempuri.org/" id="o0" SOAP-ENC:root="1">
<password xsi:type="xsd:string">1234</password>
<userName xsi:type="xsd:string">Developer</userName>
</Login>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
在调试 Web 服务时,我们发现 Web 方法(登录名和方法)可用的参数值为空。
但是,如果我们从密码和用户名中删除 xsi:type="xsd:string" 属性,一切正常。
命名空间 xsd 指向http://www.w3.org/2001/XMLSchema,这是有效的。
为什么.Net 不能反序列化响应?为什么它不抛出异常?
顺便说一句:我们的服务定义别名 http://www.w3.org/2001/XMLSchema 为“s”。这可能是个问题吗?
亲切的问候,
【问题讨论】:
-
是为了在 Stack Overflow 上的可读性而添加的
标签还是您信封的一部分? -
增加可读性:)
标签: .net web-services soap