cancel
Showing results for 
Search instead for 
Did you mean: 

XML namespace to be changed in the outgoing xml message

Former Member
0 Kudos

HI

in my scenario I am sending data to a web service .

The xml namespace that is being sent in t he data is the namespace under which the the object is created.

while sending the data to the webservice i do not want the ns0: to be attached to the message type and the xml namespace to go as the xml namespace of the vendor.

Thanks

Nikhil

Accepted Solutions (0)

Answers (3)

Answers (3)

prabhu_s2
Active Contributor
0 Kudos

In the target MT (IR) you can remove the name space.

Former Member
0 Kudos

You can remove the xml namespace from the inbound data type.

Priyanka

Former Member
0 Kudos

HI

I did that still the message going out carries the namespace value and the ns1 value.

any idea where can this be wrong now

Thanks

Nikhil

former_member206604
Active Contributor
0 Kudos

Hi,

As everyone said you need to remove the namespace in the Message Type screen. If it is a imported XSD you need to remove the attribute targetNamespace.

After doing this do the mapping once again by selecting the modified message type.

The above should work... if you are not able to solve it still you can use the following XSLT in the interface mapping after the massage mapping. This is will remove the namespaces and ns0: etc.

<?xml version="1.0" encoding="utf-8"?>
<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>

Shabarish_Nair
Active Contributor
0 Kudos

in case you are using a webservice, use the wsdl file of the WS in your mapping.

thus it will have the namespace of the vendor there. in case you have defined a Data type for the WS in IR, in its MT remove the namespace.

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