cancel
Showing results for 
Search instead for 
Did you mean: 

Remove ns1: namespace prefix in HTTP adapter

Former Member
0 Kudos

Dear Experts,

I'm facing the following issue, using the plain HTTP receiver adapter:

when I'm sending out my XML message, the "usual" ns1: namespace prefixes are added to the message.

It goes out like this:

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

<ns1:INQUIRY xmlns:ns1="urn:namespace.com:retail">

<SESSION_ID>0000157338</SESSION_ID>

<POSITION>

<item>

...

</ns1:INQUIRY>

And it should be like this:

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

<INQUIRY xmlns:ns1="urn:namespace.com:retail">

<SESSION_ID>0000157338</SESSION_ID>

<POSITION>

<item>

...

</INQUIRY>

In previous forum-threads, there are several proposed solutions:

1. using the XMLAnonymizerBean

It doesn't work here, because in plain HTTP I cannot call up any module processor (it doesn't go through the AE)

2. using XSLT to remove the complete namespace

It is not good, because I have to keep the namesapce, but without the ns1 prefixes

So, the question to you is: how to delete only(!) the ns1 prefixes, keeping the original namespace in the message.

Any comments are welcome!

Best regards,

Andras Kovacs

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear Stefan,

thank you for the helpful response!

Some thougths about the proposed solutions:

- Create external wsdl/xsd without prefix: I tried thois point with Sytlus-Studio, but here I can only delete/remove the whole namespace. If I leave the namespace in the message, the prefix will be added again as well.

- Java mapping: the general question here, how to remove something from the payload? Should we use string manipulation (like Alessandro mentions it in his blog: /people/alessandro.guarneri/blog/2006/10/13/get-rid-of-recordset-node ) or should we use here SAX ? Is there any "standard" solution for this?

- Use SOAP adapter instead of plain HTTP: it worked quite well and I could remove the prefix with the XMLAnonymizer Bean!

Here you mentioned that it can called up in "no SOAP mode". Do you mean here check in the "don't use SOAP envelope" checkbox or is it something more?

Thank you in advance for the useful responses!

Best regards,

Andras

prateek
Active Contributor
0 Kudos

<i>Should we use string manipulation or should we use here SAX ?</i>

DOM parsing would be sufficient enough.

<i>Is there any "standard" solution for this?</i>

No as far as i know.

<i>

"no SOAP mode". Do you mean here check in the "don't use SOAP envelope" checkbox or is it something more?</i>

Yes u have to check this checkbox. Also u have to include "nosoap=true" in the URL.See this under Conversion Parameters

http://help.sap.com/saphelp_nw04/helpdata/en/fc/5ad93f130f9215e10000000a155106/frameset.htm

Regards,

Prateek

stefan_grube
Active Contributor
0 Kudos

> - Use SOAP adapter instead of plain HTTP: it worked

> quite well and I could remove the prefix with the

> XMLAnonymizer Bean!

> Here you mentioned that it can called up in "no SOAP

> mode". Do you mean here check in the "don't use SOAP

> envelope" checkbox or is it something more?

Yes, that is right. I was not aware how this check box is called.

Regards

Stefan

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

- You can use the SOAP adapter in so called "no SOAP mode" than you can use the XMLAnonymizerBean.

- You can create the wsdl with an external tool (like XMLSpy) and upload the WSDL as external definition, so you can create a message type without namespace prefix.

- You can use XSLT or Java mapping to strip the prefix.

Regards

Stefan