Skip to Content
0
Former Member
Aug 27, 2012 at 04:50 PM

Change namespace prefix and change xml encoding

818 Views

I have a file to SOAP scenario,

Currently I am sending XML to the target system as below.

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

- <ns1:mensagemCliente xmlns:ns1="http://bancoconveniado/mensagemCliente">

- <cabecalho>

<dataHoraRequisicao>2012/08/27</dataHoraRequisicao>

</cabecalho>

</ns1:mensagemCliente>

What I need is to send xml to the target system as

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

- <itg:mensagemCliente xmlns:ns1="http://bancoconveniado/mensagemCliente">

- <cabecalho>

<dataHoraRequisicao>2012/08/27</dataHoraRequisicao>

</cabecalho>

</itg:mensagemCliente>

All I need to do is change the namespace prefix from ns1 to itg.

I have created a message type (mensagemCliente) using the sample xml provide by partner. Partner do not have any wsdl/xsd to share so cannot create external definition.

I have referred to Stefan’s blog and used XMLAnonymizerbean in my received SOAP communication channel module configuration.

http://scn.sap.com/people/stefan.grube/blog/2007/02/02/remove-namespace-prefix-or-change-xml-encoding-with-the-xmlanonymizerbean

Below is my module configuration in receiver SOAP Channel.

But it seems to be not working, as still I am getting the xml with old namespace prefix (ns1).

Also encoding also remains same (UTF-8). I tried to use XMLAnonymizerbean after default module XISOAPAdapterBean as well. But it didn’t work either way.

Is there anything I need to prior to using modules? Or SOAP received does not support XMLAnonymizerbean?

Or any other suggestion how this can be achieved?

Note: we are on PI 7.30

Attachments

Channel_module.jpg (30.1 kB)