on 09-16-2008 1:54 PM
Dear,
I have an Interactive Form with a ton of data on it. I'm using a Web Service to post this to PI, which then does an RFC to other systems to process the data.
In the PI monitor and using an application like SoapUI I can see and test the service. The return is put like this with constants (so it's always this, never different) :
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Header/>
<SOAP:Body>
<ns1:AdobePDF xmlns:ns1="http://host.be/pi/PI/Time_Registration">
<RETURN>Test return message</RETURN>
<ERROR>1</ERROR>
</ns1:AdobePDF>
</SOAP:Body>
</SOAP:Envelope>
I call the webservice in my form with a button with this code :
var response = SOAP.request ({
cURL: "http://host:port/XISOAPAdapter/MessageServlet?channel=:BS_TIMEREGISTRATION:CC_SOAP_UpdateTimereg&version=3.0&Sender.Service=BS_TIMEREGISTRATION&Interface=http://host.be/pi/PI/Time_Registration^MI_TimeRegistration",
oRequest: myRequest,
cAction: "http://host.be/pi/PI/TimeRegistration",
oAuthenticate: myAuthentication
});
The response should be caught in the variable <i>response</i>.
xfa.host.messageBox("Response : " + response + "","Information",3);
The above returns "Response : Object aggregate".
var result = response["AdobePDF"];
xfa.host.messageBox("Result : " + result + "","Information",3);
The above returns "Result : undefined".
var result = response["AdobePDF"]["RETURN"];
xfa.host.messageBox("Return : " + result + "","Information",3);
The above returns an error : "response.AdobePDF has no properties".
Any ideas?
Thanks in advance,
Frederik-Jan Roose
To solve this problem :
First remove the XML Namespace from the Message Type in PI.
After doing this, the XML you get back will look like this :
<AdobePDF>
<RETURN>Test return message</RETURN>
<ERROR>1</ERROR>
<AdobePDF>
If the return looks like that, you can parse it easily with javascript with the following code.
var result = response["AdobePDF"]["RETURN"];
xfa.host.messageBox("Return : " + result + "","Information",3);
This will now yield : "Return : 1". Thus, the result was correctly retrieved.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.