How to Add new Namespace to SOAP Envelope

There are some points you may face instead of keeping the body content’s namespace in the SOAP envelope, in such scenarios you can use Enrich Mediator to get this done.

Add the following enrich mediators three times and add new namespace to envelope where ever you want. And then use the new namespace inside a payload factory mediator.

      <source type="body" />
      <target type="property" property="ORG_BODY" />
      <source type="inline">
         <soapenv:Envelope xmlns:soapenv="" xmlns:newns="">
            <soapenv:Body />
      <target type="envelope" />
      <source type="property" property="ORG_BODY" />
      <target type="body" />
      <!--we have to define the new namespace here too but it doesn't appear in the new body since it's already defined in the envelope tag -->
      <newns:bodycontent xmlsns:newns="">.....</newns:bodycontent>