0

我正在调用一个 Java Web 服务,它返回一些数据。当我在 Fiddler 中查看返回的结果时,它看起来像这样:

HTTP/1.1 200 OK
Date: Thu, 18 Oct 2012 15:14:03 GMT
Server: Apache
Keep-Alive: timeout=300, max=99
Connection: Keep-Alive
Transfer-Encoding: chunked
Content-Type: text/xml; charset=UTF-8
Content-Language: en

46f
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cre="http://www.example.org/getOrderList/">
   <soapenv:Header/>
   <soapenv:Body>
      <cre:getOrderListResponse1 status="success">
          <GetOrderList company="LO" OrderNumber="0423180" CustomerNumber="2150" Branch="000" customerReference="1001" orderStatus="cancelled" suspendCode=""/>
      </cre:getOrderListResponse1>
   </soapenv:Body>
</soapenv:Envelope>

0

Fiddler 报告说“响应已编码,可能需要在检查前解码。”

我假设标题和正文之间的 4F6 和结束的 0 端正在使.Net 无法处理结果。

有什么想法可以解决这个问题吗?

编辑:看来问题可能是我正在使用 HTTP 1.1 调用服务,并且服务正在返回 HTTP 1.0。知道如何强制服务使用 HTTP 1.0 调用吗?

4

1 回答 1

0

事实证明你是完全正确的,LB 这是一个 XY 问题。

问题最终是响应中的命名空间不正确。

<soapenv:Envelope 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:cre="http://www.example.org/getOrderList/"> 

需要是

<soapenv:Envelope 
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:cre="http://www.example.org/LathamIntOE/"> 

一旦在 Java 服务中进行了更改,它就可以正常工作。

于 2012-10-18T19:23:54.063 回答