Hello all,
i want to get soap message with xpath
my code is:

<?xml version="1.0" encoding="UTF-8" ?> 
<!DOCTYPE xml (View Source for full doctype...)> 
<xml rde-rd:content="spreadshirt2.xml" rde-rd:datalanguage="de" rde-rd:leasingtime="0" rde-rd:locale="de" rde-rd:project="testwebservicegoogle" rde-rd:rdeContentType="0" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:rde-dm="http://www.reddot.de/rde/ns/dm" xmlns:rde-fdl="http://www.reddot.de/rde/ns/fdl" xmlns:rde-idea="http://www.reddot.de/rde/ns/idea" xmlns:rde-rd="http://www.reddot.de/2000/rde/rd" xmlns:rde-rdf="http://www.reddot.de/rde/ns/rdf" xmlns:rde-xmaps="http://www.reddot.de/rde/ns/xmaps" xmlns:rdf="http://www.w3.org/TR/REC-rdf-syntax/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsl-template="http://www.reddot.de/rde/ns/template">
<dynaments>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.spreadshirt.net//services.php/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<ns1:initialize_sessionResponse>
<return xsi:type="xsd:string">5999f4388c2ced3b67ffacb0ed660fb7</return> 
</ns1:initialize_sessionResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
</dynaments>
...

so if i want to get "return" result, then i use Xpath code:

xpath:xml/dynaments/*/*/*/return/text()

then i get exactelly what i want , but the problem what i have if i want for example to connect : "<ns1:initialize_sessionResponse> " then it doesn't fuction

i try with the following codes but no result:

xpath:xml/dynaments/Envelope/Body/initialize_sessionResponse/return/text()

or

xpath:xml/dynaments/SOAP-ENV:Envelope/SOAP-ENV:Body/ns1:initialize_sessionResponse/return/text()


thanks for your help

no one has any idea :-(

Your problem seems to be namespace related. I'm not sure what XPath processor you're using, but try the following:

/xml/dynaments/SOAP-ENV:Envelope/node()[local-name() = 'Body']/node()[local-name() = 'initialize_sessionResponse']/return

Phil Fearon
http://www.sketchpath.com

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.