Skip to Content
avatar image
Former Member

Source XML Structure-Two Nodes with same names

Hi All,

I have a strange situation. I am doing a Webservice to RFC scenario. The Third party vendor provided me with the Source XML fro me to create the datatype.

<?xml version="1.0" encoding="UTF-8"?>

<Envelope version="01.00">

<Sender>

<Id></Id>

<Credential></Credential>

</Sender>

<Recipient>

<Id></Id>

</Recipient>

<TransactInfo transactType="data">

<TransactId></TransactId>

<TimeStamp></TimeStamp>

</TransactInfo>

<Packet>

<PacketInfo packetType="data">

<PacketId>1</PacketId>

<Action></Action>

<Manifest></Manifest>

</PacketInfo>

<Payload><![CDATA[<?xml version="1.0"?>

<DATA_1>

<FIELD1></FIELD1>

<FIELD2></FIELD2>

<FIELD3></FIELD3>

<FIELD4></FIELD4>

<FIELD5></FIELD5>

</DATA_1>]]></Payload>

</Packet>

<Packet>

<PacketInfo packetType="data">

<PacketId>2</PacketId>

<Action></Action>

<Manifest></Manifest>

</PacketInfo>

<Payload><![CDATA[<DATA_2 language="en">

<FIELD1></FIELD1>

<FIELD2></FIELD2>

<FIELD3></FIELD3>

<FIELD4></FIELD4>

<FIELD5></FIELD5>

</DATA_2>]]></Payload>

</Packet>

</Envelope>

As We see Above, There are 2 Nodes named "Packet" at the Same level.

So When I try to create my datatype in XI based on this XML, XI wont allow to create 2 nodes with same names at the same level.

We asked the vendor to change the name of the second Packet to Packet_1, they told they cant change it.

Is there a way in XI to handle this issue??. ie to create 2 nodes with the same name at the same level??

Thanks,

Harsh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Nov 10, 2011 at 10:54 PM

    Hi,

    Thats's funy, web service is exposed by PI... but it's the thirdparty (client of our web service server) who imposes their choice for structure !! Inversed world.

    Either in Data Type, you define the "Packet" node with an occurence 0..N (or at least 0..2). That will allow you to have the 2 desired nodes by your third-party !

    Or... as your third-party does not want to chance something in their side, that means they probably already have such a web service and so a WSDL file ⚠️ or an XSD of this structure... So ask to them to provide you this WSDL, and you, you will use it as an External Def.

    regards.

    mickael

    Add comment
    10|10000 characters needed characters exceeded

    • Hello,

      The third-party has only provided you how the XML message looks like and not the XML schema. You could try recreating the schema using the data type editor but as always, the best practice is to ask for the xsds from the third-party because it would save you time in guessing which fields are needed (1..1 or 1..unbounded) and which are not (0..1 or 0..unbounded).

      Hope this helps,

      Mark

  • avatar image
    Former Member
    Nov 11, 2011 at 05:37 PM

    Hi All,

    The issue is solved. The vendor agreed to remove the second packet instead of sendin packets, they are going to put all the fields in the second packet to the first packet.

    Thank you All for your responses. It was very helpful for me in explaining it to my Vendor.

    Thanks,

    Harsh

    Add comment
    10|10000 characters needed characters exceeded