Monday, December 10, 2007

Is there any way I can upload and test an xml message from file?

This Blog is the result of transcript between me and michal who provoked me to develop an editor like WE19 for simulating XI messages flexibly. In a typical integration scenario we might need to simulate messages for testing the interfaces in different environments or for doing stress/load/performance testing. SAP did not provide any standard way for achieving the same and we expect that to happen at least in future releases. Do we need to keep our fingers crossed until future releases of XI for simulating messages? Do we stop testing our interfaces until our servers are upgraded to next support packs? No. Alternative is to exercise the power of XI ABAP stack. Let me demonstrate the power of the stack using the sample report.

I developed a report which will take a sample message and incoming XML file as an input that simulates the new message.
Source Code Extract:

Now let me depict the usage.
Sample Message Id:
Note the message id in the snap shot below which will be used later for simulating message.
Message Id
Sample Payload Content:
Find the payload content of the sample message id that is shown above.
Sample Payload Content
Payload Content that has to be simulated:
Now I want to simulate the sample message using the payload content as shown below.
Payload to be Simulated
Using the Report: Now we will execute the report using sample message id and sample payload content file that has to be simulated.
Sample Parameters for Report
Output of the Report:
After executing the report we notice that new message id is simulated as highlighted in the figure below.
New Message Id
Now let's check out the incoming payload content by double clicking the message content.We can clearly notice that the incoming paylaod is swapped with the content of our new XML file.
Simulated Message Payload

So we can easily modify and simulate messages from XI irrespective of any adapter using this sample report. We can also easily develop an editor like WE19 which takes source XML in the text editor and simulate messages or enhance it to generate n number of messages for stress/load testing. Crack the source code and build what ever you want!!!

No comments:

Blog Archive