camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet" <gno...@gmail.com>
Subject Re: Example of request reply
Date Wed, 19 Sep 2007 10:59:46 GMT
On 9/19/07, Willem Jiang <willem.jiang@gmail.com> wrote:
> Hi ,
>
> I agree to keep the binding as a separate object in the pipeline.
> And I suggest to add the in and out flage to the binding .
> form("http://soapendpoint").binding(soap, in).to("pojo.service")
> and
> from("direct").binding(soap, out).to("http://localhost:/cxfservice");

We need to agree on the terms we use I suppose.
In my mind, binding relates to databinding (xml / pojo marshaling).
So soap is not a binding in this sense.

Let aside the databinding, I think this would be a bit too verbose.
Concision usually means that the route definition is easier to read
and understand.

What about:
   from("soap:http://localhost:8080/service").
       to(requestTransformer).
       to("soap:http://host:8181/Service/").
       to(responseTransformer);

versus:  (feel free to replace soap(in) by binding(soap,in) or whatever)
   from("http://localhost:8080/service").
       soap(in).
       to(requestTransformer).
       soap(out)
       to("http://host:8181/Service/").
       to(responseTransformer);

Also, I'm not even sure that this syntax makes sense.  The soap(in) /
soap(out) are really interceptors and they must be called around the
transport endpoints.  Will the soap(out) be called with the response
from the http provider, or will the responseTransfomer be called
before ?

>
> BTW, I don't want to mix the binding and transport in a same URI,
> It will make the component 's URI handling work more complex.

This is a trade between DSL complexity and URI complexity I suppose.
URI are quite easy to read usually, even complex ones.

  failover://(tcp://localhost:61616,tcp://remotehost:61616)?initialReconnectDelay=100

The soap component code itself would maily delegate to another
component for the endpoint creation and just add interceptors to
handle soap requests.

Thoughts ?

>
> Willem.
>
> Guillaume Nodet wrote:
> > For the binding side, spring came up with oxm.
> > See http://static.springframework.org/spring-ws/site/reference/html/oxm.html
> > I'm not sure if we can reuse it or not, because it's only xml / pojo,
> > but it has support for jaxb1, jaxb2, xmlbeans, jibx, xstream and castor,
> > so it may be interesting to have a look at it.
> >
> > The idea of using composed uri is nice.  But it may be easier to use
> >    from("soap:jms:myQueue")
> > instead.  That way we could create a soap component that will mainly
> > delegate everything to the underlying transport and mainly decorate
> > the endpoint with the soap processing...  I guess we can use the uri
> > to configure properties:
> >    soap:jms:myQueue?soap.wsdl=mylocation.wsdl
> > The soap component would extract all soap.* properties and use the
> > remaining of the uri to create the transport (jms:myQueue).
> >
> > Thoughts ?
> >
> > On 9/19/07, James Strachan <james.strachan@gmail.com> wrote:
> >
> >> Sounds like a great idea! One thing I've always thought we needed was
> >> some kind of 'binding' abstraction. So you could do something like
> >>
> >>   from(someFileOrHttpOrJmsUri).
> >>     binding(someBinding).
> >>     to(someFileOrHttpOrJmsUri);
> >>
> >> where someBinding = JAXB2, jibx, xstream, Java Serialisation,
> >> CORBA/IIOP, some binary wire encoding, SOAP 1.1/1.2 or whatever. Just
> >> like we have pluggable languages/expressions, components, transformers
> >> I figured bindings is another thing we should have a library of.
> >>
> >> We've got the POJO transformation stuff, but bindings are a tad
> >> different and am thinking we need to add some kinda abstraction for
> >> this maybe?
> >>
> >> I guess another option is you could combine the endpoint + binding
> >> together into a single logical endpoint and URI.
> >>
> >>   from("jms+soap:myQueue").to("http+xml://foo/bar")
> >>
> >> but thats maybe a tad trickier to get going - its maybe simpler just
> >> having some binding abstraction first then we can tinker with it in
> >> different ways later on. As I'm thinking we might need to configure
> >> the binding in different ways (e.g. tinker with the soap interceptors
> >> - or configure properties of the binding, so keeping it a separate
> >> object in the pipeline for now is probably easiest).
> >>
> >>
> >> On 9/18/07, Guillaume Nodet <gnodet@gmail.com> wrote:
> >>
> >>> Yeah, i'm trying to dig into it.
> >>> What i'd like to do is use cxf just for soap processing.
> >>> Ideally, i'd like to have:
> >>>
> >>> from(soap("http://localhost:8192/service")).
> >>>    process(xx).
> >>>    to(soap("http://myhost:8080/another")).
> >>>    process(yy)
> >>>
> >>> which would not do any service invocation at all.
> >>> and this would require the DSL to be enhanced, but it would be like the
> >>> following (with the current dsl).
> >>>
> >>> Ideally, i'd like to be able to write:
> >>>
> >>> from("http://localhost:8192/service").
> >>>   process(new SoapConsumerServerProcessor()).
> >>>   process(xxx).
> >>>   process(new SoapProviderClientProcessor()).
> >>>   to("http://myhost:8080/another").
> >>>   process(new SoapProviderServerProcessor()).
> >>>   process(yy)
> >>>   process(new SoapConsumerClientProcessor())
> >>>
> >>> which means:
> >>>   * receive an http request,
> >>>   * perform any soap handling (ws-*) and set the content of the soap message
> >>> as the body of the in message
> >>>   * process xxx
> >>>   * wrap the message in a soap envelope
> >>>   * send the soap request to the target service
> >>>   * unwrap the soap response
> >>>   * process yyy
> >>>   * wrap the message as a soap response
> >>>   * send it back as the http response
> >>>
> >>> This is for the SOAP handling part.
> >>>
> >>> I'd like to be able to expose JAXWS pojo inside camel, but without any soap
> >>> handling, so that while inside camel, you would not use any soap stuff and
> >>> you could invoke the bean with plain xml / pojo.
> >>>
> >>> So at the end, you could write:
> >>>    from(soap("http://localhost:8080")).to("cxf:
> >>> org.apache.camel.component.cxf.HelloService")
> >>>
> >>> or something like that and that would expose the service over http.
> >>>
> >>> Now, my understanding of the cxf component is the following:
> >>>   * the consumer consumes soap requests using the cxf transports, performs
> >>> the soap processing, unmarshal the data as a list of parameters (this
> >>> depends on the DataFormat) and send it to the bus
> >>>   * the producer receives a message which contains the raw message or the
> >>> list of unmarshaled parameters, invokes the bean and send the response back.
> >>>   * i don't understand how to call an external service using camel-cxf
> >>>         from(xxx).to("cxf:http://remotehost:8080/service")
> >>>   * the DataFormat controls where the marshaling occurs (on the consumer
or
> >>> on the producer side)
> >>>   * there is no way to use jaxws to call a service inside camel using a
> >>> client proxy
> >>>
> >>> I think creating a CXF binding and a transport (it seems the current one
is
> >>> not used) as we did for JBI may be a way to solve these problems.
> >>>
> >>> Thoughts ?
> >>>
> >>>
> >>> On 9/18/07, Willem Jiang <willem.jiang@gmail.com> wrote:
> >>>
> >>>> Hi Nodet
> >>>>
> >>>> Yes, and it can perform more than service invocation part.  you can
find
> >>>> more information by check camel-cxf component code :)
> >>>>
> >>>> Cheers,
> >>>> Willem.
> >>>>
> >>>> Guillaume Nodet wrote:
> >>>>
> >>>>> Hi Willem!
> >>>>> Does the cxf component performs any soap processing using cxf ?
Or is it
> >>>>> just the marshaling / service invocation part ?
> >>>>> I'd like to leverage cxf for soap processing...
> >>>>>
> >>>>> On 9/18/07, Willem Jiang <willem.jiang@gmail.com> wrote:
> >>>>>
> >>>>>
> >>>>>> Hi ,
> >>>>>> I am working on camel-cxf component which will help you to do
some
> >>>>>> router work between 2 Web Services. My big patch just been applied
in
> >>>>>> the trunk, you can take a look at the unit test of camel-cxf
component.
> >>>>>>
> >>>>>>
> >>>>>>
> >>>> https://svn.apache.org/repos/asf/activemq/camel/trunk/components/camel-cxf/src/test/java/org/apache/camel/component/cxf/CxfRouterTest.java
> >>>>
> >>>>>> I will add a Web Service router example some time this week
 :)
> >>>>>>
> >>>>>> Willem.
> >>>>>> xtof wrote:
> >>>>>>
> >>>>>>
> >>>>>>> Hello,
> >>>>>>>
> >>>>>>> I'm quite new to Camel, and I'm trying to understand how
implementing
> >>>>>>>
> >>>> a
> >>>>
> >>>>>>> gateway between 2 Web Services. It requires to implement
a
> >>>>>>>
> >>>> request-reply
> >>>>
> >>>>>>> mechanism but I cannot find any example.
> >>>>>>> Could you help?
> >>>>>>>
> >>>>>>> Thank.
> >>>>>>> Christophe
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>
> >>>>>
> >>>>
> >>> --
> >>> Cheers,
> >>> Guillaume Nodet
> >>> ------------------------
> >>> Blog: http://gnodet.blogspot.com/
> >>>
> >>>
> >> --
> >> James
> >> -------
> >> http://macstrac.blogspot.com/
> >>
> >>
> >
> >
> >
>
>


-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/

Mime
View raw message