cancel
Showing results for 
Search instead for 
Did you mean: 

Namespace on Input Message

Former Member
0 Kudos

Hello,

I have an Input Message over HTTP which looks like that


<nsp:Message xmlns:nsp="http://nsp.de/nsp" xmlns:xsi="http://www.w3.org/2001/XMLSchema instance">
            <nsp:Info>
                        <nsp:Request>
                                   <nsp:username>admin</nsp:username>
                                   <nsp:firma>04711</nsp:firma>
                                   <nsp:filiale>001</nsp:filiale>
                                   <nsp:auftrag>0000000001</nsp:auftrag>
                                   <nsp:kunde>0815</nsp:kunde>
                                   <nsp:marke>TTT</nsp:marke>
                                   <nsp:teilenummer>123456789</nsp:teilenummer>
                        </nsp:Request>
            </nsp:Info>
</nsp:Message>

So is it possible to build a Messagetype like that?

In my Messagetype i get always ns0 and so my message mapping dosen't work.

Is there any solution to work with message mappings with this kind of input message?

regards,

robin

Accepted Solutions (1)

Accepted Solutions (1)

udo_martens
Active Contributor
0 Kudos

Hi Robin,

<a href="http://schalke-hat-es-nicht-verdient.de/resources/schalker.jpg">that could be interesting 4 u :)</a>

I dont have an IB just now and cant check that out. What about deleting the namespace at Message Type? Another idea: Download the source code of the message type (XML schema), change the prefix manually and use it as external definition.

Regards,

Udo

BTW: Where are u? I m in Oslo..

Former Member
0 Kudos

Hi Robin! In order to do that, <b>I use two XSLTs transformations</b>. The first one removes any namespaces from the source message. The second one, add the namespace ns0 to it.

<b>The first XSLT (that removes any namespaces) I found here in sdn:</b>

<?xml version="1.0" encoding="iso-8859-1"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:output method="xml" indent="no"/>

<xsl:template match="/|comment()|processing-instruction()">

<xsl:copy>

<xsl:apply-templates/>

</xsl:copy>

</xsl:template>

<xsl:template match="*">

<xsl:element name="{local-name()}">

<xsl:apply-templates select="@*|node()"/>

</xsl:element>

</xsl:template>

<xsl:template match="@*">

<xsl:attribute name="{local-name()}">

<xsl:value-of select="."/>

</xsl:attribute>

</xsl:template>

</xsl:stylesheet>

<b>The second XSLT I built myself! It maps the source message to the target message. The source and target are the same, except the target message has the namespace ns0.</b>

Hope this helps you

Julio

Former Member
0 Kudos

Hi Udo,

they get what they deserve im still in bern.

@all

idea1: use as external defenition i already try, doesn't work. I get error like "nsp:Info as attribute name not allowed". Only when i delete the "nsp:" tag i can use it as external defenition. But than i could create a new datatype as well.

idea2: delete namespace in message type. Yes i can delete it. But didn't solve anything. Ok ns0 is gone ... but message mapping still get trouble with the nsp tag.

idea3: XSLT mapping works, i know. But i would like to have a solution without doing a transformation at the beginning.

Any other ideas ?

Damn, why nobody cares about internet standards and everybody build his own bloody **** xml messages?

thanks anyway.

robin

Answers (2)

Answers (2)

Former Member
0 Kudos

Robin,

in Message Type put as XML namespace ur required namespace.

I think , then it should work. i think, prefix (whether ns0 or nsp) doesn't metter, important is the namespace.

Try it and let us know.

Peter

Message was edited by:

Peter Jarunek

Former Member
0 Kudos

I have tried to type namespace on message type definition, as Peter suggested, but it didnt work. If it works for you, Robin, please, let us know.

former_member335553
Active Contributor
0 Kudos

Hi

Check this thread if it help u ...