Hi Willem and Claus,
I have looked into the JaxbDataformat to see what I should implement. As
what I need to do for the new DataFormat is quite similiar to the
JaxbDataFormat I think two aproaches may help to avoid duplicate code.
1) I could create a processor that only removes or adds the SOAP
envelope and body. So the route would look like:
JaxbDataFormat jaxbDataFormat = new JaxbDataFormat();
from("jms:myQueue").processor(new
SoapUnwrapper()).unmarshal(jaxbDataFormat).to("bean:myBean")
Alternatively we could also use a SoapDataFormat instead of the
processor. Though I don“t know if adding or stripping SOAP is what you
would like to call a DataFormat.
2) I could add an option to JaxbDataFormat like soapSupport that
switches on or off the wrapping and unwrapping:
JaxbDataFormat jaxbDataFormat = new JaxbDataFormat();
jaxbDataFormat.setSoapSupport(true);
from("jms:myQueue").unmarshal(jaxbDataFormat).to("bean:myBean")
I think solution 1) better separates the Soap processing and makes it
easier to add functionality like SoapAction processing. On the other
hand it is more verbose and I am not sure if it performs fast enough.
Any opinions here?
Btw. I think both aproaches will also work nicely with request reply
services. For solution 2) the server side could look like this:
from("jms:myQueue").unmarshal(jaxbDataFormat).to("bean:myBean").marshal(jaxbDataFormat)
I even guess that the client side is also quite easy using the
CamelProxyFactoryBean. Something like this oculd work (though I have not
tested it):
from("direct:clientProxy").marshal(jaxbDataFormat).to("jms:myQueue").unmarshal(jaxbDataFormat)
Greetings
Christian
Am 20.01.2010 21:15, schrieb Claus Ibsen:
On Wed, Jan 20, 2010 at 4:09 PM, Schneider Christian
<christian.schnei...@enbw.com> wrote:
Hi Willem and Claus,
if you are interested I can prepare a SoapJaxbDataFormat. I propose to add
it to the camel-jaxb component.