camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Easy One way soap services
Date Thu, 21 Jan 2010 07:55:00 GMT
You could also create a SOAPDataFormat which extends JAXBDataFormat
which I think would be a good choice.
Then the JAXBDataFormat is still pure and clean in terms of JAXB.

And the SOAPDataFormat can over time have additional SOAP related stuff in it.

The code can still be in camel-jaxb if you do not bring in any new
.jar dependencies.
If you can foresee this then a new camel-soap would be a good idea,
which deps on camel-jaxb.


On Thu, Jan 21, 2010 at 8:47 AM, Willem Jiang <willem.jiang@gmail.com> wrote:
> Hi Christian,
>
> I think it dependents what you want to do for further enhancement of the
> your current solution. If you just want to add or strip the SOAP , an option
> of the JAXB DataFormat could be enough.
> If you want to do more enhancement, you'd better create a SOAP DataFormat
> for it.
>
> Willem
>
> Christian Schneider wrote:
>>
>> 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.Schneider@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.
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>>
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Mime
View raw message