cancel
Showing results for 
Search instead for 
Did you mean: 

XML Format in PI 7.1

Former Member
0 Kudos

Hi All,

Actually,I need to create the XML format for the Source fields.

I have created the source data type of Complex type.also the message type of the same name.

The contents of the data type Info are

name

age

qualification

dateofbirth

While at the receiving end I am supposed to get only 3 of them.

I have never created the XML structure previousely.

Please tell me how will it be.

If there is anything relevant to the XML format ,please tell me.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Yes in Message Mapping you can see it, when you put Test, you are going to see a Tree, but you can change the view to see the XML format. (the icon is a paper that says src)

Regards,

lpbuff

Former Member
0 Kudos

Hi ipbuff,

Thanks for the reply.

Can you please tell me the tab whre I can see the generated XML format?

Also,

Can we use it as the Source XML structure?

I am told to create the XML structure from the Test data.

Thanks in advance.

Former Member
0 Kudos

Hi,

Well when you create a data type you have a graphical structure to crete a XML structure, and you can see also the XML schema that is the definition of your structure.

With that, you included in the Message Type....and when you are going with the message mapping you add that message type and..see the stucture again...but you are in design tab.

Then in test tab in the message mapping you can see an icon to export that XML example to see the structure....

please tell me is this help you...we can explain more....

Former Member
0 Kudos

Hi Shweta,

XML message in message mapping is not automatically generated. Its only a test tab where if you provided the test xml you can test your message mapping. But if you dont ahve a xml then you can create there manually field by field what ever you want.

But you can try using a free tool oxygen and you can get it from http://www.oxygenxml.com/ for generating the xml with the help of schema. So if you have a schema this tool can generate the sample xml for you. You need to buy this one, but it has a trial version for 30 days also.

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

Thanks for the reply.

XML message in message mapping is not automatically generated. Its only a test tab where if you provided the test xml you can test your message mapping. But if you dont ahve a xml then you can create there manually field by field what ever you want.

1.Actually I need to create the Source structure(XML) from the Test data.So can I use the same XML generated in Message Mapping as the Source XML ?

2.There is no source XML mentioned for my scenerio.Can I use the generated XML as the Source XML?

3.If so,then Can Itest the Same XML in the RWB?

Thanks in advance.

Former Member
0 Kudos

Hi Shweta,

Yes you are absolutely correct. Whenever if we dont have a source xml to test as a developer we create in test tab and send the same xml from RWB and test our whole end to end scenario. So for all your questions the answer is YES.

Regards,

---Satish

Former Member
0 Kudos

sure you can use the generate XML to you source file....and also you can test in the RWB, but you hace to consider...the namespaces if your XML have it.

Former Member
0 Kudos

Hi Satish,

Thanks for the reply.

Well,as per my scenerio ,I need to mention the test data for the following fields

name

age

qualification

dateofbirth

But ,suppose the Test data sets are more than 1 that is,

name age qualification dateofbirth

hfdghgn 00 bjhh hgjhm

bfghb 01 gjhkmnj ghkj

1.Then Do i need to mention the test data for all the 2 combinations?

2.If so, then 2 XML files will be generated.Is it?

3.If so, then as the source XML file which file needs to be considered?

4. Or do I need to concatenate both the XML files without changing anything in any of the files?

Thanks in advance.

Former Member
0 Kudos

Hi ipbuff,

Thanks for the reply.

Well,as per my scenerio ,I need to mention the test data for the following fields

name

age

qualification

dateofbirth

But ,suppose the Test data sets are more than 1 that is,

name age qualification dateofbirth

hfdghgn 00 bjhh hgjhm

bfghb 01 gjhkmnj ghkj

1.Then Do i need to mention the test data for all the 2 combinations?

2.If so, then 2 XML files will be generated.Is it?

3.If so, then as the source XML file which file needs to be considered?

4. Or do I need to concatenate both the XML files without changing anything in any of the files?

Thanks in advance.

Former Member
0 Kudos

Hi Shweta,

Look is no neccesary to create replicate nodes.(you only need one XML file) ...you only have to consider one time and ocurrence.

Please create a Data type to make this....when you create a Data type...you can see the type....and also the occurence....you create a first node like "Values"

DT_type

Values (1..unbounded)

name (1)

age (1)

qualification (1)

birth (1)

Let me explain something....this would be your XML that you have the structure, but also you need the XSD (or XML schema) to validate in this file (XSD) is where the occurrence is consider.

Please, check the link that Jose send you....is a goog link....let us know if it work...

Regards,

lpbuff

Former Member
0 Kudos

Hi Shweta,

When you go to test tab you will always have one record in your tesing. So if you fill the data to what ever fields you want you will have one record and if you test this then your file will have one record.

If your file have two records then you need to create two records in your mapping test tab. But by default it has only one record, so what you do is on your source root node do a right click and click on Duplicate Subtree. It was duplicate the same structure. Now you have two records and fill both of them and take the xml. So now your file has two records. Similarly you can do extend to your test cases.

Regards,

---Satish

Former Member
0 Kudos

Hi Satish,

Thanks for the reply.

If your file have two records then you need to create two records in your mapping test tab. But by default it has only one record, so what you do is on your source root node do a right click and click on Duplicate Subtree. It was duplicate the same structure. Now you have two records and fill both of them and take the xml. So now your file has two records. Similarly you can do extend to your test cases.

1.So I should go to the Test Tab of the Message Mapping section to do this,is it?

2.After that I should click on the root node in the Test tab and should do the right click on duplicate subtree so that I can mention 2 values for 1 field and can get the 2 records ,similarly the elevant XML, is it ?

3.After that the only thing that I need to do is the copying the XML code in the XSD section which is the relevant XML file,and consider it as the Source XML Structure,is it?

Thanks in advance

Former Member
0 Kudos

Hi ipbuff,

Thanks for the reply.

If your file have two records then you need to create two records in your mapping test tab. But by default it has only one record, so what you do is on your source root node do a right click and click on Duplicate Subtree. It was duplicate the same structure. Now you have two records and fill both of them and take the xml. So now your file has two records. Similarly you can do extend to your test cases.

1.So I should go to the Test Tab of the Message Mapping section to do this,is it?

2.After that I should click on the root node in the Test tab and should do the right click on duplicate subtree so that I can mention 2 values for 1 field and can get the 2 records ,similarly the elevant XML, is it ?

3.After that the only thing that I need to do is the copying the XML code in the XSD section which is the relevant XML file,and consider it as the Source XML Structure,is it?

Thanks in advance

former_member750652
Contributor
0 Kudos

Hi Swetha,

Your understanding is right.


If your file have two records then you need to create two records in your mapping test tab. But by default it has only one record, so what you do is on your source root node do a right click and click on Duplicate Subtree. It was duplicate the same structure. Now you have two records and fill both of them and take the xml. So now your file has two records. Similarly you can do extend to your test cases. 

1.So I should go to the Test Tab of the Message Mapping section to do this,is it?

Since you want to test the message mapping for multiple records .you have to do the replication of the structure(duplicattion).if the occurenes metioned for that structure is more than one its fine .Else it will throw an error during run time due to mismatch of occurences(eg., if u mentioned occurences as 1 and if u send two records it will throw an error).


2.After that I should click on the root node in the Test tab and should do the right click on duplicate subtree so that I can mention 2 values for 1 field and can get the 2 records ,similarly the elevant XML, is it ?

Your understanding is right in this case too.You replicate the field or structure u want and give the values as u said (consider occurenes here too).It will serve your puropse.


3.After that the only thing that I need to do is the copying the XML code in the XSD section which is the relevant XML file,and consider it as the Source XML Structure,is it?

Since you mentioned that you dont have source xml to be tested .You can use the XML code that has been generated in during testing by saving it as filename.xml that u mentioned in the communication channel.

Hope you got the point.

Thanks,

Ram.

Former Member
0 Kudos

Hi Shweta,

Go to test tab and view the source. Whatever you see copy and paste here. Somebody can help you out with test cases.

Regards,

---Satish

former_member200962
Active Contributor
0 Kudos

Go to Message/ operation Mapping ---> Test ---> You will see the source message in tabular (default) view ---> Expand the structure ---> Enter the values in the fields that you want to have in the XML ---> Once all the required values have been entered Click on the SRC tab which will be available just above your Source structure ---> This will show you an editable section ---> Copy all the contents present there and save it in a notepad with an extension as .xml (file type should be All Files while saving) ---> This will create the required XML document for you.

Test Cases should be dependent on the Validations that you have used in your Mapping program or in the ID objects (like conditions in Interface/ Receiver Determination).

Regards,

Abhishek.

Former Member
0 Kudos

HI,

Yes sure....you are right...you can do the dupplicate in mapping test tab...and can extract the XML...exporting .....to have the XML source....

I think you are in good way.

Regards,

Lpbuff

Answers (3)

Answers (3)

Former Member
0 Kudos

answered

Former Member
0 Kudos

Hi..

Well it dependends of the ocurrences(optional or mandatory) that you need to handle...How ever I see you has a simple structure like this.

< Person>

- <name>

- <age>

- <qualification>

- <dateofbirth>

Former Member
0 Kudos

Hi Luis,

Thanks for the reply.

Can you please tell whether the XML format is generated automatically when we test the Message Mapping?But where?

< Person>

<name>

<age>

<qualification>

<dateofbirth>

What are the other things that need to be mentioned in the XML structure?

Can you please give me some sample XML format?

Thanks in advance.

Former Member
0 Kudos

Hi,

For more information, go to:

[http://www.w3schools.com/xml/default.asp|http://www.w3schools.com/xml/default.asp]

You need to have clear the standards in xml.

Regards

Ivan

Former Member
0 Kudos

Hi Jose,

Can we genrate the XML format in the Message Mapping automatically?If so then how?

Thanks in advance.

prateek
Active Contributor
0 Kudos

Test tab of Message mapping and then checking Source not helping you? Or I am missing something?

Regards,

Prateek

Former Member
0 Kudos

Hi Prateek,

Thanks for the reply.

Means ,the XML format is generated automatically when we test the Message Mapping?But where?

Please tell me.

Thanks in advance.