cancel
Showing results for 
Search instead for 
Did you mean: 

Source XML Structure-Two Nodes with same names

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Mickael,

Thanks, for your quick reply. I am sorry it is a Http to Rfc scenario. Not a Webservice. Its a Http Post. Any Ideas?

Thanks,

Harsh

baskar_gopalakrishnan2
Active Contributor
0 Kudos

You cannot have same tag element within the same hierarch level in XML. This is pretty standard. Whatever protocol you use that is not the issue here. You can have same name at different level of hierarchy in XML structure. Since you create structure for them to consume, inform the client about this rule.

markangelo_dihiansan
Active Contributor
0 Kudos

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