cancel
Showing results for 
Search instead for 
Did you mean: 

Remove the namespaces from the SOAP response message

ramu_g4
Participant
0 Kudos

Hi Experts,

We are working on synchronous interface Webservice to S4 (SOAP(Axis) <-> Proxy) in SAP PO 7.5 single stack.

We have requirement to remove the Namespaces with definitions (xsd and xsi). Looks like these additional Namespaces are getting added in SOAP receiver channel.

Can I use "XMLAnonymizerBean" standard module to modify the SOAP response messages? Please find the below Output of SOAP sender channel and the expected SOAP response message by sender system and the sender system always expects SOAP response without that namespace.

Requirement:

To remove the below namespaces from the SOAP response message.

(1) xmlns:xsd="http://www.w3.org/2001/XMLSchema"

(2) xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance”SAP PO Release: NW750EXT_25_REL; Service Pack: 25

SOAP (Axis) sender adapter with Quality of Service as ‘Best Effort’ is being usedIn the sender SOAP (Axis) channel, AF_Modules/XMLAnonymizerBean has been configured with the parameter anonymizer.acceptNamespaces. But the namespaces are getting removed as expected.

Test Case 1: (XMLAnonymizerBean after CallSapAdapter)Output:Test Case 2: (XMLAnonymizerBean after AFAdapterBean)Output:Test Case 3: (XMLAnonymizerBean as the last module)Output:Note:

The namespaces (xmlns:xsd=http://www.w3.org/2001/XMLSchema and xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance) are not present after Operation Mapping response message execution. These payloads are present after the response message execution in SOAP (Axis) sender adapter. So, XSLT/Java mapping could not be used to remove these namespaces.

After Operation mapping executionFinal PO output message after processing:Regards

Ramu

Accepted Solutions (0)

Answers (2)

Answers (2)

Bhargavakrishna
Active Contributor
0 Kudos

Hi Ramu,

Remove unwanted namespaces:

The use of the "XMLAnonymizerBean" standard module appears to be a good approach.

Ensure that the "XMLAnonymizerBean" module is placed as the last module in the Sender SOAP Axis channel, right before the message is sent to the sender system.

Configure the module's parameters as follows:

Parameter Name: anonymizer.acceptNamespaces

Value: Add the namespaces you want to retain. In your case, it should be empty since you want to remove the namespaces.

Refer the below blog for your reference.

https://blogs.sap.com/2014/10/02/remove-namespace-by-xmlanonymizer-bean-in-communication-channel/

Remove SOAP envelope

In channel, Under Payload Extraction, select which part of the Axis SOAP message to take the main payload of the XI message from:

  • SOAP Body Child
  • SOAP Body
  • SOAP Envelope

I suggest selecting the SOAP Body and test the interface.

if it's not working, the next option would be to go for the custom adapter module option.

Regards

Bhargava Krishna Talasila

hurrybob
Explorer
0 Kudos

Hi Ramu,

Is SOAP envelope required? If no, you can check 'Do not Use SOAP Envelope' parameter in your sender channel.

If it is required, check 'Do not Use SOAP Envelope' and use XSLT to add only required envelope tag.

Regards,

Hari.

ramu_g4
Participant
0 Kudos

hi Hari,

We are working on Synchronous interface SOAP(Axis) <-> Proxy.

SOAP envelope is required in SOAP response message and it is expected by sender system.

I can check "Do not use SOAP envelope" in SOAP sender channel but it sends without soap envelope to sender.

How to use XSLT mapping again later?

Thanks

hurrybob
Explorer
0 Kudos

You can add XSLT after actual response mapping step in Operation mapping.

ramu_g4
Participant
0 Kudos

Hi Hari,

We are using SOAP(Axis) adapter, but not usual SOAP adapter. There is no option to use "Do not use SOAP Envelope" in SOAP Axis adapter like how we have SOAP sender adapter. Can you pls guide how to suppress SOAP envelope in Sender adapter?

Thanks

Ramu