cancel
Showing results for 
Search instead for 
Did you mean: 

Preprossing possible to add namespace to message?

former_member185171
Participant
0 Kudos

Hi,

we have an interface running via PI with some provider.

We send an HTTP request to the provider and an XML file returns. However this file contains no reference to any namespace and the parsing from the XML to the corresponding ABAP structure does not work.

Is there any possibility of preprocessing so we can add this necessary namespace before the parsing starts?

Thanks a lot.

Kris

Accepted Solutions (1)

Accepted Solutions (1)

stefan_grube
Active Contributor
0 Kudos

When you have defined the interface in ESR, so you can remove the XML namespace in the message type, regenerate the ABAP proxy (if you use one) and then the parsing should work.

Maybe you write something more about the scenario.

former_member185171
Participant
0 Kudos

The scenario in brief:

We send an HTTP-request to out provider. This works well.

In return we get an xml file back. We do not have any detailed description of this file (no xsd). I generated an xsd-file from the returned output an imported this in the repository as an external definition.

This is a sample of the returned xml file:

<?xml version="1.0"?>

<DOWNLOAD_REPLY>

<TRANSMISSION LEVEL="Order" DESCRIP="- Order date -">

<GROUP1 ACTION="">

<GROUP2 DATEORDER="1/2010">

<PAYMENT ID="6169845" REF="40000000504A13"></PAYMENT>

<PAYMENT ID="6179207" REF="400000005025EB"></PAYMENT>

</GROUP2>

</GROUP1>

</TRANSMISSION>

</DOWNLOAD_REPLY>

That is as far as we get.

We use a proxy to retrieve our data: based on the external definition, we make an interface and then the proxy.

Apparently SAP has a problem parsing this xml into the abap structures.

We think the problem could be caused by the absence of an namespace in the xml, and we would like to add that to the message, before the parsing begins. This could possibly be done in a mapping u2013 or by regenerating the proxy after removing the namespace. But I donu2019t see the how-to of these two options.

Any advice, please.

Kris

Former Member
0 Kudos

by parsing to ABAP structures do u say the error you get is when the proxy call is made to SAP system

do you have a mapping in your scenario. if so the normal mapping of the XML reposnse to your proxy response structure shoud be working....

or

is the parsing error is in XI itself

former_member185171
Participant
0 Kudos

The parsing problem does not seem to occur in XI, because in the monitor I see no errors.

When I test the proxy in transaction SPROXY I only get the 'Original Response' tab and not the definite 'Response'.

I can do some mapping, but I just think there is a namespace missing in the response xml. I can add that in a mapping apparently, but I do not know how.

Can anyone get me some coding-instructions - a concrete example e.g.?

Thanks a lot.

Kris

stefan_grube
Active Contributor
0 Kudos

In ESR/ Integration repository

Edit the message type (corresponding to the interface)

Look for the field XML namespace (under data type used)

Remove the value in that field

save and activate.

in application system. regenerate the proxy for the interface.

save and activate.

btw: You can create a test message in sproxy for that inbound proxy, so you can compare the structure.

former_member185171
Participant
0 Kudos

Can this also be done when the message is imported in an external definition?

Former Member
0 Kudos

for the proxy message type that u shud have created urself in ESR try removing the target message type and c if it works

stefan_grube
Active Contributor
0 Kudos

Why you do not simply try it and let us know, if this works for you?

former_member185171
Participant
0 Kudos

It was more than simply trying, but it seems to work.

Thanks.

Kris

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

This can be achieved using simple java mapping where the necessary namespace can be added.

Regards,

Swetha.

former_member185171
Participant
0 Kudos

Swetha,

I'm not really experienced in mapping. do you have any exemple I might user?

Thanks a lot.

Kris

Former Member
0 Kudos

Hi Kris,

try XMLAnonymizerBean. See doc in SAP Help.

kr,

Peter