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


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

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

<?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">
<someMethod xmlns="http://test.com/services/myservice/">

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