synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Upul Godage" <upulg....@gmail.com>
Subject Re: Synapse mediator - Insert an element into soap xml
Date Tue, 19 Feb 2008 08:46:36 GMT
Hi,

If you are adding an element to the body element, you can use addChild()
etc.
If you are adding a header to the SOAP envelope then you can do something
like this.

        SOAPHeaderBlock newBlock =
ctx.getEnvelope().getHeader().addHeaderBlock("userid",
ns);
         newBlock.setText("text"); //etc.

Upul



On Feb 19, 2008 1:21 PM, Venkatesan, Kumaran <
Kumaran.Venkatesan@in.standardchartered.com> wrote:

>  Hi,
>
>
>
> The requirement is to insert an element into the soap xml before sending
> it to the backend service in the mediation layer.
>
> Have created an element using AXIOM but facing issue in injecting it to
> the soap.
>
> * *
>
> *      public* *boolean* mediate(MessageContext ctx) {
>
>           System.*out*.println("Inside the Router Mediator");
>
>           SOAPBody soapBody = ctx.getEnvelope().getBody();
>
>           OMFactory omf = soapBody.getOMFactory();
>
>           OMElement ome = omf.createOMElement("userid", *null*);
>
>           ome.setText("PSSWEBBANK");
>
>           System.*out*.println("soap body "+ctx.getEnvelope().getBody());
>
>             *return* *true*;
>
>       }
>
>
>
> How to do this?
>
> This email is confidential. If you are not the addressee tell the sender immediately
and destroy this email
> without using, sending or storing it. Emails are not secure and may suffer errors, viruses,
delay,
> interception and amendment. Standard Chartered PLC and subsidiaries ("SCGroup") do not
accept liability for
> damage caused by this email and may monitor email traffic.
>
>

Mime
View raw message