DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
DataStageRocker



Group memberships:
Premium Members

Joined: 01 Apr 2015
Posts: 9
Location: United States
Points: 344

Post Posted: Sun Feb 02, 2020 5:50 pm Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Parallel
OS: Unix
Hello,

I got a requirement to create a XML string and send it to a SOAP based API. After so many attempts i was able to get it work using Hierarchical stage. The input message should look like

Code:
<?xml version="1.0" encoding="utf-8"?>
<m cid="[int]" pwd="[string]" subunitid="[int]" rid="[string]">
  <call>
    <arg context=”UniqueID” name="userid">[int]</arg>
    <arg name="typeid">[int]</arg>
    <arg name="statusid">[int]</arg>
    <arg name="requirementid">[int]</arg>
    <arg name="note">[string]</arg>
    <arg name="eventdate">[date]</arg>
    <arg name="expiredate">[date]</arg>
  </call>
</m>


The incoming data is from a table and had to transform multiple columns into a single hierarchical column under a list. For this i used Input step, Regroup stage, HPivot step 1, H pivot step 2, Union Step, XML composer, Output step and then to webservices transformer stage(API call)

Regroup step - id credential's as key field.
HPivot step 1 -- to create <arg context=”UniqueID” name="userid">[int]</arg> as context ='UniqueID' is a harcoded value and has to be added to the first attribite "userid"
HPivot step 2 - to create remaining list.
Union step - to combine two lists in a sinlge list as it is the only step i can hardcode "UniqueID" to context attibute as per XSD.

The above request is working with out any issues. I am facing an issue/confused while reading response message. The arg name list is the request attributes and d name list will be the response attributes. I need to parse and make the record linear and load it in a table.

The output columns should look like

userid|typeid|expiredate|icid|eventdate|requirementid|typeid|note|status|userid|archive

response message--

Code:
<?xml version="1.0" encoding="UTF-8"?>
<m authenticated="1" cid="XXX" rid="xxx" subunitid="xxxx">
   <call>
      <arg context="UniqueID" name="userid">xxxxxx</arg>
      <arg name="typeid">xxxx</arg>
      <resp status="1">
         <t>
            <r>
               <d NAME="expiredate">xxxx</d>
               <d NAME="icid">xxxxx</d>
               <d NAME="eventdate">xxxxx</d>
               <d NAME="requirementid">x</d>
               <d NAME="typeid">xxxx</d>
               <d NAME="note">xxxx.</d>
               <d NAME="statusid">1</d>
               <d NAME="userid">xxxx</d>
               <d NAME="archive">0</d>
            </r>
         </t>
      </resp>
   </call>
</m


---------------------------------
<arg context="UniqueID" name="userid">xxxxxx</arg>
<arg name="typeid">xxxx</arg>
-------------------- --- this will be unique for a user but can have multiple response records for a user.

I have followed similar steps in Hierarchical stage like XML parser, V-pivot step 1 , V-pivot step 2 and got stuck whether to use re-group step, union step,order join, hjoin, output. Could you please provide some inputs on how to parse response XML message.

I tried multiple options but the job was failing with error messages and unable to debug..

Hierarchical_Data_226,0: Message bundle error Can't find resource for bundle com.ibm.e2.Bundle_E2_engine_msgs, key E2IllegalStateException.missingStartItemCallOnParent

Hierarchical_Data_226,0: Fatal Error: 2020-02-03 19:43:13,736 Fatal [Projection-8] [] Invalid parent cursor
com.ibm.e2.core.exceptions.E2IllegalStateException: MissingStartItemCallOnParent frame = 'ProjectRuntime:Op-RT-2[Projection-8]', cursorPath = 'd'

below is the XSD generated from response xml output message

Code:
<?xml version="1.0" encoding="utf-8"?>
<!-- Created with Liquid Technologies Online Tools 1.0 (https://www.liquid-technologies.com) -->
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="m">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="call">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="arg">
                <xs:complexType>
                  <xs:simpleContent>
                    <xs:extension base="xs:string">
                      <xs:attribute name="context" type="xs:string" use="optional" />
                      <xs:attribute name="name" type="xs:string" use="required" />
                    </xs:extension>
                  </xs:simpleContent>
                </xs:complexType>
              </xs:element>
              <xs:element name="resp">
                <xs:complexType>
                  <xs:sequence>
                    <xs:element name="t">
                      <xs:complexType>
                        <xs:sequence>
                          <xs:element name="r">
                            <xs:complexType>
                              <xs:sequence>
                                <xs:element maxOccurs="unbounded" name="d">
                                  <xs:complexType>
                                    <xs:simpleContent>
                                      <xs:extension base="xs:string">
                                        <xs:attribute name="NAME" type="xs:string" use="required" />
                                      </xs:extension>
                                    </xs:simpleContent>
                                  </xs:complexType>
                                </xs:element>
                              </xs:sequence>
                            </xs:complexType>
                          </xs:element>
                        </xs:sequence>
                      </xs:complexType>
                    </xs:element>
                  </xs:sequence>
                  <xs:attribute name="status" type="xs:unsignedByte" use="required" />
                </xs:complexType>
              </xs:element>
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
      <xs:attribute name="authenticated" type="xs:unsignedByte" use="required" />
      <xs:attribute name="cid" type="xs:unsignedShort" use="required" />
      <xs:attribute name="rid" type="xs:string" use="required" />
      <xs:attribute name="subunitid" type="xs:unsignedShort" use="required" />
    </xs:complexType>
  </xs:element>
</xs:schema>



Thanks in advance
chulett

Premium Poster


since January 2006

Group memberships:
Premium Members, Inner Circle, Server to Parallel Transition Group

Joined: 12 Nov 2002
Posts: 43085
Location: Denver, CO
Points: 222463

Post Posted: Mon Feb 03, 2020 2:53 am Reply with quote    Back to top    

Can't help on the specifics of your issue but with 'IllegalStateException' error messages like that, in your shoes I would be involving your official support provider.

_________________
-craig

"You can never have too many knives" -- Logan Nine Fingers
Rate this response:  
Not yet rated
asorrell
Site Admin

Group memberships:
Premium Members, DSXchange Team, Inner Circle, Server to Parallel Transition Group

Joined: 04 Apr 2003
Posts: 1704
Location: Colleyville, Texas
Points: 23166

Post Posted: Tue Feb 11, 2020 1:55 pm Reply with quote    Back to top    

Only other way to isolate the problem is to gradually remove sections from the Hierarchical stage to see when the error message goes away. That would tell you at least what section caused the error.

But yes - you might want to call customer service on it to get their take on the problem.

_________________
Andy Sorrell
Certified DataStage Consultant
IBM Analytics Champion 2009 - 2020
Rate this response:  
Not yet rated
eostic

Premium Poster



Group memberships:
Premium Members

Joined: 17 Oct 2005
Posts: 3833

Points: 30939

Post Posted: Tue Feb 18, 2020 9:28 am Reply with quote    Back to top    

Simpler solution --- work on dumping the entire response as a single "chunked" text column (like "myXMLresponse")... send it to a sequential file with NONE for delimiter and for quote character and ma ...

_________________
Ernie Ostic

blogit!
Open IGC is Here!
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours