- Suhas Shravagi
- PowerBuilder
- Monday, 21 September 2020 04:38 PM UTC
Hi, I had raised the same question earlier, but didn't receive any answer. So raising the question again. I've implemented HTTPSClient object to get the response from a SOAP WebService in a desktop application (PB 2017 R3). The response is stored in a string variable and has below value:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"; xmlns:xsd="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">;
<soapenv:Body>
<myfunctionResponse xmlns="http://tempurl.com">;
<myfunctionReturn>Ret_Val_1</myfunctionReturn>
<myfunctionReturn>Ret_Val_2</myfunctionReturn>
<myfunctionReturn>Ret_Val_3</myfunctionReturn>
</myfunctionResponse>
</soapenv:Body>
</soapenv:Envelope>
Now my need is to get the three return parameters (Ret_Val_1, Ret_Val_2, and Ret_Val_3.) I tried with PBDOM objects but it is always return only first element (Ret_Val_1) always.Is there anything that I can do to resolve this issue? I have below piece of code now:
//---------------------------------------------------------------
lpbdom_Builder = CREATE PBDOM_BUILDER
lpbdom_doc = CREATE PBDOM_DOCUMENT
TRY
// generate XML Document
lpbdom_Doc = lpbdom_Builder.BuildFromString(ls_xml_data)
ls_value = lpbdom_Doc.GetRootElement().&
GetChildElement("Body", "soapenv","http://schemas.xmlsoap.org/soap/envelope/";).&
GetChildElement("myfunctionResponse","","http://tempurl.com";).&
GetChildElement("myfunctionReturn","","http://tempurl.com";).getText()
MessageBox("ls_value", ls_value)
CATCH (PBDOM_Exception lpbdom_Except)
MessageBox( "PBDOM_Exception", lpbdom_Except.GetExceptionCode())
END TRY
DESTROY lpbdom_Builder
//---------------------------------------------------------------
Find Questions by Tag
Helpful?
If a reply or comment is helpful for you, please don’t hesitate to click the Helpful button. This action is further confirmation of their invaluable contribution to the Appeon Community.