Big news! The community will be moving to a new platform April 21. Read more.
Big news! The community will be moving to a new platform April 21. Read more.
Cadet 3rd Class Cadet 3rd Class
Cadet 3rd Class
417 views

Hi, I am unable to extract value from server response


Notify: Saving Parameter "OutputParameter = <basicInvokeResponse xmlns="http://www.abc.com/services/argobasicservice"><basicInvokeResponse>&lt;argo-response status="0" status-id="OK"&gt;&lt;argo:gate-response xmlns:argo="http://www.abc.com/argo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.abc.com/argo GateWebserviceResponse.xsd"&gt;&lt;create-appointment-response&gt;&lt;gate-id&gt;VG GATE&lt;/gate-id&gt;&lt;appointment-nbr&gt;2642079&lt;/appointment-nbr&gt;&lt;slot slot-start="2020-10-31T03:00:00" slot-end="2020-10-31T03:59:00" /&gt;&lt;tran-type&gt;PI&lt;/tran-type&gt;&lt;appointment requires-xray="false" /&gt;&lt;container eqid="IMPO1112225" /&gt;&lt;chassis is-owners="false" /&gt;&lt;truck license-nbr="PTSep1602" trucking-co-id="AM" /&gt;&lt;external-ref-nbr&gt;19341014&lt;/external-ref-nbr&gt;&lt;/create-appointment-response&gt;&lt;/argo:gate-response&gt;&lt;/argo-response&gt;</basicInvokeResponse></basicInvokeResponse>".
Action.c(97): "lr_xml_extract" succeeded, 1 match processed
Action.c(103): Notify: Parameter Substitution: parameter "OutputParameter" = "<basicInvokeResponse xmlns="http://www.abc.com/services/argobasicservice"><basicInvokeResponse>&lt;argo-response status="0" status-id="OK"&gt;&lt;argo:gate-response xmlns:argo="http://www.abc.com/argo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.abc.com/argo GateWebserviceResponse.xsd"&gt;&lt;create-appointment-response&gt;&lt;gate-id&gt;VG GATE&lt;/gate-id&gt;&lt;appointment-nbr&gt;2642079&lt;/appointment-nbr&gt;&lt;slot slot-start="2020-10-31T03:00:00" slot-end="2020-10-31T03:59:00" /&gt;&lt;tran-type&gt;PUI&lt;/tran-type&gt;&lt;appointment requires-xray="false" /&gt;&lt;container eqid="IMPO1112225" /&gt;&lt;chassis is-owners="false" /&gt;&lt;truck license-nbr="PTSep1602" trucking-co-id="AAAM" /&gt;&lt;external-ref-nbr&gt;19341014&lt;/external-ref-nbr&gt;&lt;/create-appointment-response&gt;&lt;/argo:gate-response&gt;&lt;/argo-response&gt;</basicInvokeResponse></basicInvokeResponse>"
Action.c(103): Output is : <basicInvokeResponse xmlns="http://www.abc.com/services/argobasicservice"><basicInvokeResponse>&lt;argo-response status="0" status-id="OK"&gt;&lt;argo:gate-response xmlns:argo="http://www.abc.com/argo" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.abc.com/argo GateWebserviceResponse.xsd"&gt;&lt;create-appointment-response&gt;&lt;gate-id&gt;VG GATE&lt;/gate-id&gt;&lt;appointment-nbr&gt;2642079&lt;/appointment-nbr&gt;&lt;slot slot-start="2020-10-31T03:00:00" slot-end="2020-10-31T03:59:00" /&gt;&lt;tran-type&gt;PI&lt;/tran-type&gt;&lt;appointment requires-xray="false" /&gt;&lt;container eqid="IMPO1112225" /&gt;&lt;chassis is-owners="false" /&gt;&lt;truck license-nbr="PTSep1602" trucking-co-id="AM" /&gt;&lt;external-ref-nbr&gt;19341014&lt;/external-ref-nbr&gt;&lt;/create-appointment-response&gt;&lt;/argo:gate-response&gt;&lt;/argo-response&gt;</basicInvokeResponse></basicInvokeResponse>
Action.c(105): Warning: The string 'PARAM_1' with parameter delimiters is not a parameter.
Action.c(105): Notify: Saving Parameter "test1 = {PARAM_1}".


I am unable to extract particular value from response which is &gt;&lt;appointment-nbr&gt;2642079&lt;/appointment-nbr&gt.

when i am using lr_xml extract i am getting entire response.

lr_xml_extract("XML={CreateAppointment}",
"Query=/soapenv:Envelope/soapenv:Body/basicInvokeResponse",
"XMLFragmentParam=OutputParameter",
//"SelectAll=yes",
LAST);

could any one please help regarding this.

0 Likes
2 Replies
Cadet 3rd Class Cadet 3rd Class
Cadet 3rd Class

Thank you. it was related to LoadRunner.
0 Likes
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Hi,

Escaped characters like &gt; and &lt; can not be understood by lr_xml_extract,  please convert them into '<' and '>'

The query path should also reach the node you are going to find, here in your case, it should reach to "appointment-nbr"

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.