cancel
Showing results for 
Search instead for 
Did you mean: 

ns:0 instead of ns:0 in output xml

vkaushik82
Active Participant
0 Kudos

Hello All,

I have a problem with target namescape prefix.

Output xml contains ns:1 where as i want this to be ns:0

I have a XSD Vendor on target side and RFC struture in source side.I found in Message mapping itself 1st field i.e. root node Vendor coming as

ns:1Vendor

Can anyone help me how i can change this.

Regards,

Vikrant

Accepted Solutions (0)

Answers (5)

Answers (5)

stefan_grube
Active Contributor
0 Kudos

> I have a problem with target namescape prefix.

> Output xml contains ns:1 where as i want this to be ns:0

You need not change this. It does not matter what prefix you have.

Former Member
0 Kudos

Hi Vikrant,

One way is to develop the custom adapter module, read the payload content into a string by using getText() method, replace the prefix ns:1 to ns:0 and set the payload back by using the method setText()

Regards,

Chandra Shekhar.

Former Member
0 Kudos

Hi ,

Use Custom Adapter Module and use Java Method ReplaceAll ( ns0:, ns1:);

It will replace all values or nodes with ns0: by ns1:

This will be more precise and can be achievable at one go.

Regards,

Anurag Garg

prateek
Active Contributor
0 Kudos

Have you tried an end-to-end configuration without changing anything?

This namespace should not matter actually. Do your receiver side only accepts ns:0?

Regards,

Prateek

vkaushik82
Active Participant
0 Kudos

I tried end to end this is working perfectly.

Problem is with receiver they need ns:0 instead of ns:1.

Former Member
0 Kudos

Hi Kaushik,

You can try using XMLAnonymizerBean as mentioned by stefan in this blog:

/people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean

else you can open your target xsd and change the prefix of the namespace which should take care of this.

Regards,

---Satish

vkaushik82
Active Participant
0 Kudos

My target xsd looks like as below

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

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:novartis.com:pi:test:SHAHSH7" targetNamespace="urn:novartis.com:pi:test:SHAHSH7">

<xsd:element name="Vendors" type="Vendors" />

<xsd:complexType name="Vendors">

<xsd:sequence>

<xsd:element name="Vendor" minOccurs="0" maxOccurs="unbounded">

<xsd:complexType>

<xsd:sequence>

<xsd:element name="Vendor_No" type="xsd:string" minOccurs="0">

</xsd:element>

<xsd:element name="Active_Ind_01" type="xsd:string" minOccurs="0">

</xsd:element>

<xsd:element name="Active_Ind_02" type="xsd:string" minOccurs="0">

.

.

Can you please let me know where i can make a change which will refelect this .

Former Member
0 Kudos

Vikrant,

Did you try the stefans blog at the reciver communication channel. In the blog in has given example to remove the namespace instead you can try the same for adding, so instead of '' you can give ns0 and give a try.

Regards,

---Satish