I have a simple .NET app that makes a SOAP call to a third party Axis web service. When I trace the HTTP traffic, I see that the Request looks fine, however I'm getting an exception: "Response is not well-formed XML." The return object is null, as it seems the XML can't be deserialized.
我有一个简单的.NET应用程序,它向第三方Axis Web服务进行SOAP调用。当我跟踪HTTP流量时,我看到Request看起来很好,但是我得到了一个例外:“响应不是格式良好的XML。”返回对象为null,因为似乎无法反序列化XML。
One question regarding the various namespace declarations inside the wsdl. Several of these declarations point to URLs / domains that no longer exist. Could this cause any problems?
关于wsdl中各种命名空间声明的一个问题。其中一些声明指向不再存在的URL /域。这会导致任何问题吗?
From the wsdl document:
从wsdl文档:
<wsdl:definitions targetNamespace="http://domaindoesntexist.com/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://domaindoesntexist.com/"
xmlns:intf="http://domaindoesntexist.com/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
A sample HTTP response with incriminating data removed:
删除了有罪数据的示例HTTP响应:
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Transfer-Encoding: chunked
Date: Fri, 05 Jun 2009 13:54:59 GMT
7cb
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<someMethod xmlns="http://test.com/services/myservice/">
</someMethod>
</soapenv:Body>
</soapenv:Envelope>
0
3 个解决方案
#1
It has been my experience that namespace URLs do not have to be actual existing URIs. Consistency is what is desired, so internal XML schemas can be built for validation. The intent was (I believe) to host the namespace definition at that location so that developers could go there and check it out, but then people got lazy.
根据我的经验,命名空间URL不必是实际的现有URI。一致性是您所期望的,因此可以构建内部XML模式以进行验证。目的是(我相信)在该位置托管命名空间定义,以便开发人员可以去那里检查它,但随后人们变得懒惰。
I may, in fact, be quite wrong on that latter count.
事实上,我可能在后一种情况下是错误的。
#2
Several of these declarations point to URLs / domains that no longer exist. Could this cause any problems?
其中一些声明指向不再存在的URL /域。这会导致任何问题吗?
Sure. Have you tried updating the webservice in your project?
当然。您是否尝试更新项目中的Web服务?
#3
I had a similar problem and after looking into Wireshark trace it was found that there is a Proxy server which is inserting some headers in the XML payload
我遇到了类似的问题,在查看Wireshark跟踪后发现有一个代理服务器在XML有效负载中插入一些头文件
webservice is trying to load xml
webservice正在尝试加载xml
"Content-Type: text/xml;charset=utf-8 Vary: Accept-Encoding,User-Agent Connection: close Transfer-Encoding: chunked 2rZ3fnB2rMzDjipXgQz8ObOcEczeOIO74sa17YK5hrPkt62qce12BItOmuvPrC/WD8N3xZzBeBceBbiAA0IlsR2aXxd479Es7wO9va2cGpF/cc284gI.K5FXbOR5PUPx00EqNRjCdbdU4fv/JXN2alGDzGVlgCnRK5/6DJlAkcED2011-06-08T15:35:21.505Z"
“内容类型:文本/ XML;字符集= utf-8的不同而不同:接受编码,用户代理连接:关闭传送编码:分块2rZ3fnB2rMzDjipXgQz8ObOcEczeOIO74sa17YK5hrPkt62qce12BItOmuvPrC / WD8N3xZzBeBceBbiAA0IlsR2aXxd479Es7wO9va2cGpF / cc284gI.K5FXbOR5PUPx00EqNRjCdbdU4fv / JXN2alGDzGVlgCnRK5 / 6DJlAkcED2011-06-08T15:35:21.505 Z”
which obviously will not load.
这显然不会加载。
The complete tcp stream in my case
在我的情况下完整的TCP流
POST /ls/ws/auth HTTP/1.1
POST / ls / ws / auth HTTP / 1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.3615)
User-Agent:Mozilla / 4.0(兼容; MSIE 6.0; MS Web服务客户端协议2.0.50727.3615)
Content-Type: text/xml; charset=utf-8
Content-Type:text / xml;字符集= utf-8的
SOAPAction: ""
Host: ??????
Content-Length: 487
Expect: 100-continue
Connection: Keep-Alive
2PUldqLs2KqUkJryFiZPQJI.D6RCixeMu443SLd7dCF2qrzws0E2JYatTqm8wD2CuFrSVHEjvJHIXfiLy6w9yBagentfp093.0.1.9019HTTP/1.0 200 OK
2PUldqLs2KqUkJryFiZPQJI.D6RCixeMu443SLd7dCF2qrzws0E2JYatTqm8wD2CuFrSVHEjvJHIXfiLy6w9yBagentfp093.0.1.9019HTTP / 1.0 200 OK
Date: Wed, 08 Jun 2011 15:35:21 GMT
日期:2011年6月8日星期三,格林威治标准时间15:35:21
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Vary: Accept-Encoding,User-Agent
X-Cache: MISS from dgtproxy1.skybroadband.com.ph
X-Cache:来自dgtproxy1.skybroadband.com.ph的MISS
Connection: close
.1
Content-Type: text/xml;charset=utf-8
Vary: Accept-Encoding,User-Agent
Connection: close
Transfer-Encoding: chunked
2rZ3fnB2rMzDjipXgQz8ObOcEczeOIO74sa17YK5hrPkt62qce12BItOmuvPrC/WD8N3xZzBeBceBbiAA0IlsR2aXxd479Es7wO9va2cGpF/cc284gI.K5FXbOR5PUPx00EqNRjCdbdU4fv/JXN2alGDzGVlgCnRK5/6DJlAkcED2011-06-08T15:35:21.505Z
#1
It has been my experience that namespace URLs do not have to be actual existing URIs. Consistency is what is desired, so internal XML schemas can be built for validation. The intent was (I believe) to host the namespace definition at that location so that developers could go there and check it out, but then people got lazy.
根据我的经验,命名空间URL不必是实际的现有URI。一致性是您所期望的,因此可以构建内部XML模式以进行验证。目的是(我相信)在该位置托管命名空间定义,以便开发人员可以去那里检查它,但随后人们变得懒惰。
I may, in fact, be quite wrong on that latter count.
事实上,我可能在后一种情况下是错误的。
#2
Several of these declarations point to URLs / domains that no longer exist. Could this cause any problems?
其中一些声明指向不再存在的URL /域。这会导致任何问题吗?
Sure. Have you tried updating the webservice in your project?
当然。您是否尝试更新项目中的Web服务?
#3
I had a similar problem and after looking into Wireshark trace it was found that there is a Proxy server which is inserting some headers in the XML payload
我遇到了类似的问题,在查看Wireshark跟踪后发现有一个代理服务器在XML有效负载中插入一些头文件
webservice is trying to load xml
webservice正在尝试加载xml
"Content-Type: text/xml;charset=utf-8 Vary: Accept-Encoding,User-Agent Connection: close Transfer-Encoding: chunked 2rZ3fnB2rMzDjipXgQz8ObOcEczeOIO74sa17YK5hrPkt62qce12BItOmuvPrC/WD8N3xZzBeBceBbiAA0IlsR2aXxd479Es7wO9va2cGpF/cc284gI.K5FXbOR5PUPx00EqNRjCdbdU4fv/JXN2alGDzGVlgCnRK5/6DJlAkcED2011-06-08T15:35:21.505Z"
“内容类型:文本/ XML;字符集= utf-8的不同而不同:接受编码,用户代理连接:关闭传送编码:分块2rZ3fnB2rMzDjipXgQz8ObOcEczeOIO74sa17YK5hrPkt62qce12BItOmuvPrC / WD8N3xZzBeBceBbiAA0IlsR2aXxd479Es7wO9va2cGpF / cc284gI.K5FXbOR5PUPx00EqNRjCdbdU4fv / JXN2alGDzGVlgCnRK5 / 6DJlAkcED2011-06-08T15:35:21.505 Z”
which obviously will not load.
这显然不会加载。
The complete tcp stream in my case
在我的情况下完整的TCP流
POST /ls/ws/auth HTTP/1.1
POST / ls / ws / auth HTTP / 1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.3615)
User-Agent:Mozilla / 4.0(兼容; MSIE 6.0; MS Web服务客户端协议2.0.50727.3615)
Content-Type: text/xml; charset=utf-8
Content-Type:text / xml;字符集= utf-8的
SOAPAction: ""
Host: ??????
Content-Length: 487
Expect: 100-continue
Connection: Keep-Alive
2PUldqLs2KqUkJryFiZPQJI.D6RCixeMu443SLd7dCF2qrzws0E2JYatTqm8wD2CuFrSVHEjvJHIXfiLy6w9yBagentfp093.0.1.9019HTTP/1.0 200 OK
2PUldqLs2KqUkJryFiZPQJI.D6RCixeMu443SLd7dCF2qrzws0E2JYatTqm8wD2CuFrSVHEjvJHIXfiLy6w9yBagentfp093.0.1.9019HTTP / 1.0 200 OK
Date: Wed, 08 Jun 2011 15:35:21 GMT
日期:2011年6月8日星期三,格林威治标准时间15:35:21
Server: Apache-Coyote/1.1
Content-Type: text/xml;charset=utf-8
Vary: Accept-Encoding,User-Agent
X-Cache: MISS from dgtproxy1.skybroadband.com.ph
X-Cache:来自dgtproxy1.skybroadband.com.ph的MISS
Connection: close
.1
Content-Type: text/xml;charset=utf-8
Vary: Accept-Encoding,User-Agent
Connection: close
Transfer-Encoding: chunked
2rZ3fnB2rMzDjipXgQz8ObOcEczeOIO74sa17YK5hrPkt62qce12BItOmuvPrC/WD8N3xZzBeBceBbiAA0IlsR2aXxd479Es7wO9va2cGpF/cc284gI.K5FXbOR5PUPx00EqNRjCdbdU4fv/JXN2alGDzGVlgCnRK5/6DJlAkcED2011-06-08T15:35:21.505Z