cancel
Showing results for 
Search instead for 
Did you mean: 

Message Prefix

Former Member
0 Kudos

We have agreed with a customer on the message type to be exchanged. For simplicity let's say:

<OrderCreate>

..

</OrderCreate>

I have created the relevant mapping rules, but when I want to test the mapping (in Design) with a test message the customer sent us, I get an error. This is because the customer is using a prefix:

<COC:OrderCreate>

..

</COC:OrderCreate>.

When I remove this prefix manually erverything is ok. My question: How do I introduce this prefix is my message definition, or how do I get rid of this prefix when the message is processed?

Kind regards,

John.

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi John,

this prefix is standing for a namespace. Search for "xmlns". You should find:

<myElement xmlns:COC="myNamespace">

Your message type has by default the namespace, where it is created but you can give there a individual namespace.

Regards,

Udo

Former Member
0 Kudos

Thanks Udo, this helps, but this solves my problem only partially, because I have the definition of the message only in DTD format (External Definition). You can't create a message type (and thus attach your own XML namespace) for an External Definition, as the message type is derived from the first element.

I would have to transform the DTD into an XSD format, to be able to create a Datatype and a Message type. Unfortunately, it's a rather complicated definition. Is there any possibility to get from an DTD to an XSD format?

Regards,

John.

udo_martens
Active Contributor
0 Kudos

Hi John,

there are serveral possibilities: Take XML Spy (professional version), where you have a menu function for creating XSD from DTD. Or, just avoid using of message mapping (take for example XSLT). The interface will then not be validated during runtime, a dummy would be enough.

Regards,

Udo

henrique_pinto
Active Contributor
0 Kudos

If your problem was just the prefix itself, I'd recomend you to use Anonymizer Module Processor (it can be used together with any other adapter module). Cehck SAP Note 880173 for more information.

But since your problem is the message definition itself, I'd make a XSLT mapping (where you can define your prefixes and also namespaces) and invoke it using MessageTransformBean (it's another module processor). For more information on how to use this module, check the end of this blog: https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2620. [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]

Regards,

Henrique.

Former Member
0 Kudos

Hello Henrique,

You state: Anonymizer Module Processor (it can be used together with any other adapter module). But we are using the HTTP-adapter and the tab 'Module' is greyed out. For all other adapters I can enter seperate Modules.

Are you able to use modules with the HTTP adapter?

Regards,

John.

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi John,

I am not very sure, but I think you can take the help of the module processor for this problem...have a look at the following thread:-

Also, please post a sample of where exactly this prefix is getting attached when you are testing your mapping...'cuz generally, the prefix is should not matter much while mapping.

Regards,

Sushumna

Former Member
0 Kudos

Hi sushumna,

The module processor would help probably, but the standard HTTP adapter will be used, and the "Module" tab is greyed out for this adapter?

It is not a problem of the mapping itself, but loading the test message will make all nodes red for the source message. By removing the prefix all nodes go green.

Regards,

John.