1

我有一个 .Net 应用程序,它对在 JBoss7.1 上运行的服务进行 Web 服务调用。来自 Linux(使用 Mono 2.10.2)和 Windows(下)的“登录”方法之一的 SOAP 请求是不同的。虽然它们看起来相当(我认为),但从 Linux 执行会导致服务器故障并出现异常'Unmarshalling Error: unexpected element (uri:"http://ws.array.mod.abc.com/", local:"username") . 预期元素是 <{}username>,<{}password>'

Linux(Mono 2.10.2)
==================
POST /array_ws/ArrayService?WSDL HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Content-Length: 335
Expect: 100-continue
Connection: keep-alive
Host: 10.10.5.61:8080

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body>
      <login xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://ws.array.mod.abc.com/">
         <username>admin</username>
         <password>admin</password>
      </login>
   </s:Body>
</s:Envelope>

Windows
=======
POST /array_ws/ArrayService?WSDL HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: ""
Host: 10.10.5.61:8080
Content-Length: 312
Expect: 100-continue
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <login xmlns="http://ws.array.mod.abc.com/">
         <username xmlns="">admin</username>
         <password xmlns="">admin</password>
      </login>
   </s:Body>
</s:Envelope>

当我将 xmlns="" 添加到用户名和密码字段并从 Linux 对服务器进行直接 SOAP 调用时,它工作正常。是否有任何我必须更改的单声道库/我必须执行的 JBoss Web 服务配置才能使其正常工作?

4

0 回答 0