You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ICAR <ic...@gmail.com> on 2007/09/25 16:53:46 UTC
Envelope Wrapper
Hi. We want to implement the Envelope Wrapper describes in to EIP Book.
In a camel component, we receive a message. Example
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="http://icar.unibas.it/FreESBee">
<env:Header>
<tns:test>XXX</tns:test>
</env:Header>
<env:Body>
<tns:greet>
<tns:s>ICAR</tns:s>
</tns:greet>
</env:Body>
</env:Envelope>
now we want create a message like
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:tns="http://icar.unibas.it/FreESBee">
<env:Header/>
<env:Body>
<tns:test>XXX</tns:test>
</env:Header>
<env:Body>
<tns:greet>
<tns:s>ICAR</tns:s>
</tns:greet>
</env:Body>
</env:Body>
</env:Envelope>
i.e.: encapsulate a message into another..
we have wrote
this.from("jbi:service:...")
.process(new ProcessorWrapper())
.to("log:foo");
private class ProcessorWrapper implements Processor{
public void process(Exchange exchange) throws Exception {
//WRAPPING LOGIC
}
}
how we can thake the whole message (header + body) and put it into the body
of another?
--
View this message in context: http://www.nabble.com/Envelope-Wrapper-tf4516108s22882.html#a12881386
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Envelope Wrapper
Posted by James Strachan <ja...@gmail.com>.
On 25/09/2007, ICAR <ic...@gmail.com> wrote:
>
> Hi. We want to implement the Envelope Wrapper describes in to EIP Book.
> In a camel component, we receive a message. Example
>
> <?xml version="1.0" encoding="UTF-8"?>
> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:tns="http://icar.unibas.it/FreESBee">
> <env:Header>
> <tns:test>XXX</tns:test>
> </env:Header>
> <env:Body>
> <tns:greet>
> <tns:s>ICAR</tns:s>
> </tns:greet>
> </env:Body>
> </env:Envelope>
>
> now we want create a message like
>
> <?xml version="1.0" encoding="UTF-8"?>
> <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:tns="http://icar.unibas.it/FreESBee">
> <env:Header/>
> <env:Body>
>
> <tns:test>XXX</tns:test>
> </env:Header>
> <env:Body>
> <tns:greet>
> <tns:s>ICAR</tns:s>
> </tns:greet>
> </env:Body>
>
> </env:Body>
> </env:Envelope>
>
> i.e.: encapsulate a message into another..
>
> we have wrote
>
> this.from("jbi:service:...")
> .process(new ProcessorWrapper())
> .to("log:foo");
>
>
> private class ProcessorWrapper implements Processor{
> public void process(Exchange exchange) throws Exception {
> //WRAPPING LOGIC
> }
> }
>
>
> how we can thake the whole message (header + body) and put it into the body
> of another?
In this particular case the message body is a blob of XML which
contains an XML header; so its just a matter of doing the XML
wrapping. e.g. using XQuery, XSLT or some JAXB2 code etc.
If this is SOAP you might wanna look at using camel-cxf so that CXF
can do the SOAP handling and SOAP wrapping/unwrapping etc.
--
James
-------
http://macstrac.blogspot.com/
Open Source SOA
http://open.iona.com