Xml – .NET client getting “not well formed” XML response from Axis web service

.net-2.0axissoapxml

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.

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?

From the wsdl document:

<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/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

Best Solution

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.

I may, in fact, be quite wrong on that latter count.

Related Question