SXI Forum

A place to collect usefull tips, tricks and implementation strategies.

You are not logged in.

#1 22-11-2018 07:04:42

Registered: 20-11-2018
Posts: 148

Extracting information from Elements returned by a Web Service Call


Can I please ask your assist with an xpath to collect a ticket number written in memory from as a response.

Attached is an XPress document from a json string written to memory and our field of interest is the "display_value" tag

I am not sure how to pick that value.

Please assist

XPress doc

<?xml version="1.0" encoding="iso-8859-1"?>
<XServiceBroker xmlns="">
		<Object xmlns="">
			<import_set type="string">ISET0013048</import_set>
			<result class="array">
			<Element class="object">
			<display_name type="string">number</display_name>
			<display_value type="string">INC0068191</display_value>
			<record_link type="string"></record_link>
			<status type="string">inserted</status>
			<sys_id type="string">a949c7f1db716240ca53f1fabf961943</sys_id>
			<table type="string">incident</table>
			<transform_map type="string">Event Management Incident</transform_map>
			<staging_table type="string">u_event_mgmt</staging_table>


#2 22-11-2018 08:16:33

Registered: 20-11-2018
Posts: 148

Re: Extracting information from Elements returned by a Web Service Call

The XML here is returned as a response to a Web Service call.

So the issue here is not an incorrect Xpath but rather the fact that you are trying to address an element which has not been loaded into memory.

To call a Web Service with X-ServiceBroker a "Create" mapping is used, as one needs to send information to the Web Service. This create is usually done with the aid of a stylesheet to construct the correct payload needed by the Web Service being consumed. The response returned by the Web Service is not automatically loaded into memory as it would have been had a Collect mapping being run.

Because of this, IMMEDIATELY following the Create mapping used to call the Web Service, one needs to call a Data Definition to extract the information elements from the response, this is typically done with a MemoryDataManipultion mapping. In the said DataDefinition the element can successfully be addressed with an XPath statement.


Board footer

Powered by FluxBB