Problem with XForms and answer from a webservice
Posted: Fri Nov 04, 2005 4:07 pm
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.
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.