W3C home > Mailing lists > Public > www-forms@w3.org > November 2005

XForms: how to access data inside answer from webservice?

From: ni cha bo <nichabo@hotmail.com>
Date: Fri, 04 Nov 2005 13:19:34 +0000
Message-ID: <BAY109-F2FEF8F35C21882AB3F4C1AF600@phx.gbl>
To: www-forms@w3.org

Ok, here's the thing: I made a simple form where you can enter a login and a 
password. This information is sent to an existing webservice by using SOAP, 
and the webservice returns a session id, and a session starttime.

Here is what the answer from the webservice looks like (after I've written 
it to a file) :

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soapenv:Envelope 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" 
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001XMLSchema" 
xmlns:xsi="http://www.w3.org/2001XMLSchema-instance" 
xmlns:tns="urn:uniface:applic:services:synchroweb" 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">

<soapenv:Body>
<tns:QUESTIONANDANSWER>
<return xsi:type="xsd:int">0</return>
<PIO_REQUEST xsi:type="xsd:string">
& lt;?xml version="1.0" encoding="utf-8" standalone="yes"?& gt;
& lt;LoginResponse& gt;
& lt;session& gt;EB46A231-B3DD-4FFB-B5CC-953AA3DCF053& lt;/session& gt;
& lt;sessionstarttime& gt;2005110413552100& lt;/sessionstarttime& gt;
& lt;/LoginResponse& gt;</PIO_REQUEST>
</tns:QUESTIONANDANSWER>
</soapenv:Body>
</soapenv:Envelope>



If I write to the file using the following code:

<xforms:submission id="write_file" method="put"
ref="instance('iResults')//PIO_REQUEST/child::text()"
replace="none"
action="file:/iResults.xml"
/>

Then the file iResults.xml looks like this:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
& lt;?xml version="1.0" encoding="utf-8" standalone="yes"?& gt;
& lt;LoginResponse& gt;
& lt;session& gt;8C8D4EC0-DF18-4892-836B-5D1945B10090& lt;/session& gt;
& lt;sessionstarttime& gt;2005110414061700& lt;/sessionstarttime& gt;
& lt;/LoginResponse& gt;

Does anybody know how I can access "session" and "sessionstarttime" that are 
inside LoginResponse? This has been bugging me for weeks...

(I added a space in & lt en & gt myself, so that you can see that it is 
really a string like that, that I recieve).

I really hope anybody can help.

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today - it's FREE! 
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Received on Tuesday, 8 November 2005 05:49:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 10 March 2012 06:22:02 GMT