Hi,
I'm trying to write a routine to extract results from a web service written
in VS 2005 using XPath, however VS doesn't put a prefix on result namespaces
by default, so in the output from a service such as
<soap:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<MyTest5Response xmlns="adam">
<MyTest5Result>
<testInt>9</testInt>
<testStruct>
<z>
<MyStruct><x>0</x><y>0</y><z>0</z></MyStruct>
<MyStruct><x>0</x><y>0</y><z>0</z></MyStruct>
</z>
</testStruct>
</MyTest5Result>
</MyTest5Response>
</soap:Body>
</soap:Envelope>
I can not use XPath to extract anything lower than soap:Body by name, e.g.
/soap:Envelope/soap:Body/MyTest5Response is invalid as MyTest5Response has no
namespace prefix.
Does anyone know if either
1) I'm wrong, and there is a valid XPath to the response / results nodes
2) It's possible to specify a prefix which will be output by the web service
3) There's an easy XSLT transform I could apply after calling the web
service to add a prefix (I have no knowledge of transforms myself); this
would be better, as I'll also have to interface with services written by
other companies.
The consumer program is not being produced in any VS languages, so I can't
use anything like XmlNamespaceManager or other .Net / VS features.
Thanks in advance,
Adam