WISD Output stage with multiple objects single response XML

Dedicated to DataStage and DataStage TX editions featuring IBM<sup>®</sup> Service-Oriented Architectures.

Moderators: chulett, rschirm

Post Reply
Prithwiraj
Participant
Posts: 2
Joined: Thu Dec 28, 2006 2:14 pm

WISD Output stage with multiple objects single response XML

Post by Prithwiraj »

We have a Web Service job where source is a WISD input stage and the target is WISD output. Previously we used to standardize the address and then expose the job as a service and service is called from UI(Lombardi). Now we have new requirement . we have to standardize as well as validate the address . So for every request XML that is sent by the UI team we need to create one response xml with multiple objects in it . Now we are getting only one object in the response xml . I tried to use XML output stage before WISD output stage to get two objects in one response xml of WISD output stage but it is not working.

Currently the request and response are as below

RERUEST

===========




<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>
<ws_ADDRESS_STAND_AR_OPERATION_TEST xmlns="http://ADDRESS_STAND_AR_SERVICE_TEST.ADDRESS_STANDARD_AR_Test.isd.ibm.com/soapoverhttp/">
<key xmlns="">00100</key>
<addressline1 xmlns="">400 SW WALTON</addressline1>
<addressline2 xmlns="">PHY ADDR LINE2</addressline2>
<addressline3 xmlns="" />
<addressline4 xmlns="" />
<city xmlns="">BENTONVILLE</city>
<state xmlns="">AR</state>
<county xmlns="">BENTON</county>
<country xmlns="">US</country>
<postalcode xmlns="">72712-0000</postalcode>
<srccountry xmlns="">US</srccountry>
<source xmlns="" />
</ws_ADDRESS_STAND_AR_OPERATION_TEST>
</soapenv:Body>
</soapenv:Envelope>




RESPONSE
=============




<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<p423:ws_ADDRESS_STAND_AR_OPERATION_TESTResponse xmlns:p423="http://ADDRESS_STAND_AR_SERVICE_TEST.ADDRESS_STANDARD_AR_Test.isd.ibm.com/soapoverhttp/">
<ws_ADDRESS_STAND_AR_OPERATION_TESTReturn>
<key>100</key>
<addressline1>400 SW WALTON</addressline1>
<addressline2>PHY ADDR LINE2</addressline2>
<addressline3 />
<addressline4 />
<city>BENTONVILLE</city>
<state>AR</state>
<county>BENTON</county>
<country>US</country>
<postalcode>72712-0000</postalcode>
<srccountry>US</srccountry>
<source />
<is_validated>Y</is_validated>
</ws_ADDRESS_STAND_AR_OPERATION_TESTReturn>
</p423:ws_ADDRESS_STAND_AR_OPERATION_TESTResponse>
</soapenv:Body>
</soapenv:Envelope>

But the UI want the response xml as below.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<p423:ws_ADDRESS_STAND_AR_OPERATION_TESTResponse xmlns:p423="http://ADDRESS_STAND_AR_SERVICE_TEST.ADDRESS_STANDARD_AR_Test.isd.ibm.com/soapoverhttp/">
<ws_ADDRESS_STAND_AR_OPERATION_TESTReturn>
<key>100</key>
<addressline1>400 SW WALTON</addressline1>
<addressline2>PHY ADDR LINE2</addressline2>
<addressline3 />
<addressline4 />
<city>BENTONVILLE</city>
<state>AR</state>
<county>BENTON</county>
<country>US</country>
<postalcode>72712-0000</postalcode>
<srccountry>US</srccountry>
<source />
<is_validated>Y</is_validated>
<key>100</key>
<addressline1>400 SW WALTON</addressline1>
<addressline2>PHY ADDR LINE2</addressline2>
<addressline3 />
<addressline4 />
<city>BENTONVILLE</city>
<state>AR</state>
<county>BENTON</county>
<country>US</country>
<postalcode>72712-0000</postalcode>
<srccountry>US</srccountry>
<source />
<is_validated>Y</is_validated>
</ws_ADDRESS_STAND_AR_OPERATION_TESTReturn>
</p423:ws_ADDRESS_STAND_AR_OPERATION_TESTResponse>
</soapenv:Body>
</soapenv:Envelope>

. Please give suggestion how to handle this.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

That's a pretty ugly xml body. There's very little formal structure to it, except maybe the "order" of the elements. The easiest thing to do is to have the UI change it's requirement and conform to "your" WSDL from ISD....one that defines the first address uniquely from the second (I am assuming that's why there are two "sets" of address lines?).....

Otherwise, what you could do, at the very least, is send back a single column (one big varchar column) and they could parse it themselves, with this payload, and then build this exact xml --- probably inside of a transformer. There are no repeating nodes, so a bunch of concatenations might be the easiest thing to do --- you won't have to worry about any formal structure. They will still have to alter the GUI, however, to first absorb a single column from the SOAP envelope (one that contains xml) and then parse out the xml.

If you have 8.5, you could use the Text over HTTP binding and then the payload will be returned as they expect.

Bottom line --- ISD dictates the WSDL and the format of the input and output messages. You can't get it to easily "adopt" the format of another client or WSDL. Simplest solution is for them to change the gui to your particular output link and generated WSDL.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Prithwiraj
Participant
Posts: 2
Joined: Thu Dec 28, 2006 2:14 pm

Post by Prithwiraj »

There was some changes in the response XML structure. It should look like this.

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<p423:ws_ADDRESS_STAND_AR_OPERATION_TESTResponse xmlns:p423="http://ADDRESS_STAND_AR_SERVICE_TEST.ADDRESS_STANDARD_AR_Test.isd.ibm.com/soapoverhttp/">
<ws_ADDRESS_STAND_AR_OPERATION_TESTReturn>
<Address>
<key>100</key>
<addressline1>400 SW WALTON</addressline1>
<addressline2>PHY ADDR LINE2</addressline2>
<addressline3 />
<addressline4 />
<city>BENTONVILLE</city>
<state>AR</state>
<county>BENTON</county>
<country>US</country>
<postalcode>72712-0000</postalcode>
<srccountry>US</srccountry>
<source />
<is_validated>Y</is_validated>
</Address>
<Address>
<key>100</key>
<addressline1>400 SW WALTON</addressline1>
<addressline2>PHY ADDR LINE2</addressline2>
<addressline3 />
<addressline4 />
<city>BENTONVILLE</city>
<state>AR</state>
<county>BENTON</county>
<country>US</country>
<postalcode>72712-0000</postalcode>
<srccountry>US</srccountry>
<source />
<is_validated>Y</is_validated>
</Address>
</ws_ADDRESS_STAND_AR_OPERATION_TESTReturn>
</p423:ws_ADDRESS_STAND_AR_OPERATION_TESTResponse>
</soapenv:Body>
</soapenv:Envelope>

I have enabled the return array and getting the desired output. Marking the topic as resolved.
Post Reply