cancel
Showing results for 
Search instead for 
Did you mean: 

Severe Problem With Message Mapping

Former Member
0 Kudos

Hi,

I have got a message mapping which results in the following XML:

<?xml version="1.0" encoding="UTF-8"?>

<ns14:expost_generation xmlns:ns14="http://mywebsite.xsd">

<timeStamp>2006-03-15T15:27:16</timeStamp>

<source name="xyz">

<generation date="abc" value="def" />

<generation date="abc" value="def" />

<generation date="abc" value="def" />

</source>

</ns14:expost_generation>

My problem is that I have to suppres the ns14 prefix. The opening tag should be: <expost_generation xmlns="http://mywebsite.xsd">

The closing tag: </expost_generation>

Does anybody know how to achieve this?

Kind regards,

Heiko

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Heiko,

You could try this:

Create an XSD for your target message in an external tool (like notepad or a xml editor).

Import the XSD at the node Interface Objects -> External Definitions.

Use this XSD directly (by drag and drop) in your message and interface mapping.

Now you are in complete control of the namespaces.

Regards,

Arjan Aalbers

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Heiko,

on the level of the expost_generation-Tag the two definitions you gave are logically equivalent. Hence, no software consuming the XMLs should prefer one style.

However, when we look at the subelements there is a great difference.

In the xml you posted first all subelements (timeStamp, source,...) lie in no namespace.

On the other hand when you declare the tag expost_generation as you described afterwards (with a default namespace declaration) and then proceed as in the first example, then all the subelements will lie in this namespace, too (unless you again reset the default namespace in all these elements).

I assume that the Schema you use in the Message Mapping describes a document with only the root being namespace qualified but the service consuming the document expects a document with all tags being namespace qualified.

Greetings

Stephan

Former Member
0 Kudos

Hi Stephan,

thanks for your analysis. This might be the case. Unfortunately we have no influence on the behaviour of the message consumer. But a collegue of mine has found a solution to the problem. We remove the namespace declaration from the message type. We add the namspace afterwards, using an XSLT based mapping.

Cheers,

Heiko

moorthy
Active Contributor
0 Kudos

Hi Heiko,

The namespace prefix will automatically addaed by XI in Mapping. If you want you can avoid the namespaces in the Message Type.

Go thru this link might be useful.

/people/sameer.shadab/blog/2005/12/05/how-to-remove-namespaces-in-mapping--xi

Regards,

Moorthy

Former Member
0 Kudos

Hi Krishna,

unfortunately I need the namspace definition but not the prefix. Seems the only way is to handcraft the mapping...

Regards,

Heiko