You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Marrad <ma...@hotmail.com> on 2006/09/14 13:08:23 UTC
Re: Servicemix-http configuring soapAction and locationURI
dynamically
Hi,
I have extended the AbstractContentBasedRouter as suggested, implementing
getDestination, to dynamically route messages to external endpoints. It
works so far as the external endpoint (Axis) is called. The problem I have
is that it says that the SOAPAction is not set. I guess it has to be set as
a http header, not as a request parameter. Any ideas on how to do this?
Thanks,
Markus
gnodet wrote:
>
> I was talking mainly about endpoint resolution.
>
> You should write a custom component which would be used as the target
> for your jbi exchanges (instead of the http provider endpoint).
> This component would use endpoint resolution as shown in the code snippet:
>
> DocumentFragment epr =
> URIResolver.createWSAEPR("http://host/path?http.soapAction=myAction");
> ServiceEndpoint se = getContext().resolveEndpointReference(epr);
> exchange.setEndpoint(se);
> send(exchange);
>
> Then, you can create the URI the way you want by extracting these
> informations from the incoming exchange
> and give it to the createWSAEPR call.
> The component would just forward the incoming exchange to the dynamic
> endpoint.
>
> As this is the role of the EIP ContentBasedRouter, I have just refactored
> it
> in an abstract class so it should be easier to extend.
> You could define you own EIP router:
>
> <eip:component>
> <eip:endpoints>
> <bean class="com.my.company.MyRouter" />
> </eip:endpoints>
> </eip:component>
>
> And have
> public class MyRouter extends AbstractContentBasedRouter {
> protected ExchangeTarget getDestination(MessageExchange exchange)
> throws
> Exception {
> String locationUri = xxx;
> String soapAction = xxx;
> ExchangeTarget target = new ExchangeTarget();
> target.setUri(locationUri + "?soapAction=" + soapAction);
> return target;
> }
> }
>
> Does it make more sense ?
>
> On 8/7/06, Sufyan Arif <SA...@rdfgroup.com> wrote:
>>
>> Ok thanks I can try using that approach but it's not very clear how I do
>> that.
>>
>> So let me get this clear on the provider I set something like
>>
>> locationURI="interface:http://somenamespace/MyInterface"
>>
>>
>> Do I then have to write an implementation of MyInterface and deploy it
>> as a servicemix component? Does the interface need to implement a
>> specific callback method?
>>
>>
>> Thanks
>>
>>
>> Sufyan
>>
>>
>> -----Original Message-----
>> From: Guillaume Nodet [mailto:gnodet@gmail.com]
>> Sent: 07 August 2006 16:35
>> To: servicemix-users@geronimo.apache.org
>> Subject: Re: Servicemix-http configuring soapAction and locationURI
>> dynamically
>>
>> Mmm, the soapAction could be easily done, but the locationURI would
>> conflict
>> with the consumer endpoint. We would need to first split the consumer
>> endpoints
>> and provider endpoints, but this is not planned for the next release.
>>
>> Have you tried using URIs / dynamic endpoint resolution instead ?
>> See http://servicemix.goopen.org/site/uris.html
>>
>> On 8/7/06, Sufyan Arif <SA...@rdfgroup.com> wrote:
>> >
>> > Hi,
>> >
>> >
>> >
>> > Is it possible to configure the Provider endpoint soapAction and
>> > locationURI using Xpath expressions?
>> >
>> >
>> >
>> > What I want to do is to define the end point once in servicemix.xml
>> and
>> > then examine the normalised message using xpath to obtain the
>> > locationURI and pass this to the Provider.
>> >
>> >
>> >
>> > Thanks
>> >
>> >
>> >
>> >
>> >
>> > Sufyan
>> >
>> >
>> > This transmission is confidential and intended solely for the person
>> or
>> > organisation to whom it is addressed. It may contain privileged and
>> > confidential information. If you are not the intended recipient, you
>> should
>> > not copy, distribute or take any action in reliance on it. If you have
>> > received this transmission in error, please notify the sender
>> immediately.
>> > Any opinions or advice contained in this e-mail are those of the
>> individual
>> > sender except where they are stated to be the views of RDF Group plc.
>> All
>> > messages passing through this gateway are virus scanned.
>> >
>> >
>> >
>>
>>
>> --
>> Cheers,
>> Guillaume Nodet
>>
>
>
>
> --
> Cheers,
> Guillaume Nodet
>
>
--
View this message in context: http://www.nabble.com/Servicemix-http-configuring-soapAction-and-locationURI-dynamically-tf2064314.html#a6303678
Sent from the ServiceMix - User forum at Nabble.com.
Re: Servicemix-http configuring soapAction and locationURI dynamically
Posted by Guillaume Nodet <gn...@gmail.com>.
You should try target.setUri(locationUri + "?http.soapAction=" + soapAction);
All query parameters prefixed by "http." will be set as properties
on the HttpEndpoint.
On 9/14/06, Marrad <ma...@hotmail.com> wrote:
>
> Hi,
>
> I have extended the AbstractContentBasedRouter as suggested, implementing
> getDestination, to dynamically route messages to external endpoints. It
> works so far as the external endpoint (Axis) is called. The problem I have
> is that it says that the SOAPAction is not set. I guess it has to be set as
> a http header, not as a request parameter. Any ideas on how to do this?
>
> Thanks,
> Markus
>
>
> gnodet wrote:
> >
> > I was talking mainly about endpoint resolution.
> >
> > You should write a custom component which would be used as the target
> > for your jbi exchanges (instead of the http provider endpoint).
> > This component would use endpoint resolution as shown in the code snippet:
> >
> > DocumentFragment epr =
> > URIResolver.createWSAEPR("http://host/path?http.soapAction=myAction");
> > ServiceEndpoint se = getContext().resolveEndpointReference(epr);
> > exchange.setEndpoint(se);
> > send(exchange);
> >
> > Then, you can create the URI the way you want by extracting these
> > informations from the incoming exchange
> > and give it to the createWSAEPR call.
> > The component would just forward the incoming exchange to the dynamic
> > endpoint.
> >
> > As this is the role of the EIP ContentBasedRouter, I have just refactored
> > it
> > in an abstract class so it should be easier to extend.
> > You could define you own EIP router:
> >
> > <eip:component>
> > <eip:endpoints>
> > <bean class="com.my.company.MyRouter" />
> > </eip:endpoints>
> > </eip:component>
> >
> > And have
> > public class MyRouter extends AbstractContentBasedRouter {
> > protected ExchangeTarget getDestination(MessageExchange exchange)
> > throws
> > Exception {
> > String locationUri = xxx;
> > String soapAction = xxx;
> > ExchangeTarget target = new ExchangeTarget();
> > target.setUri(locationUri + "?soapAction=" + soapAction);
> > return target;
> > }
> > }
> >
> > Does it make more sense ?
> >
> > On 8/7/06, Sufyan Arif <SA...@rdfgroup.com> wrote:
> >>
> >> Ok thanks I can try using that approach but it's not very clear how I do
> >> that.
> >>
> >> So let me get this clear on the provider I set something like
> >>
> >> locationURI="interface:http://somenamespace/MyInterface"
> >>
> >>
> >> Do I then have to write an implementation of MyInterface and deploy it
> >> as a servicemix component? Does the interface need to implement a
> >> specific callback method?
> >>
> >>
> >> Thanks
> >>
> >>
> >> Sufyan
> >>
> >>
> >> -----Original Message-----
> >> From: Guillaume Nodet [mailto:gnodet@gmail.com]
> >> Sent: 07 August 2006 16:35
> >> To: servicemix-users@geronimo.apache.org
> >> Subject: Re: Servicemix-http configuring soapAction and locationURI
> >> dynamically
> >>
> >> Mmm, the soapAction could be easily done, but the locationURI would
> >> conflict
> >> with the consumer endpoint. We would need to first split the consumer
> >> endpoints
> >> and provider endpoints, but this is not planned for the next release.
> >>
> >> Have you tried using URIs / dynamic endpoint resolution instead ?
> >> See http://servicemix.goopen.org/site/uris.html
> >>
> >> On 8/7/06, Sufyan Arif <SA...@rdfgroup.com> wrote:
> >> >
> >> > Hi,
> >> >
> >> >
> >> >
> >> > Is it possible to configure the Provider endpoint soapAction and
> >> > locationURI using Xpath expressions?
> >> >
> >> >
> >> >
> >> > What I want to do is to define the end point once in servicemix.xml
> >> and
> >> > then examine the normalised message using xpath to obtain the
> >> > locationURI and pass this to the Provider.
> >> >
> >> >
> >> >
> >> > Thanks
> >> >
> >> >
> >> >
> >> >
> >> >
> >> > Sufyan
> >> >
> >> >
> >> > This transmission is confidential and intended solely for the person
> >> or
> >> > organisation to whom it is addressed. It may contain privileged and
> >> > confidential information. If you are not the intended recipient, you
> >> should
> >> > not copy, distribute or take any action in reliance on it. If you have
> >> > received this transmission in error, please notify the sender
> >> immediately.
> >> > Any opinions or advice contained in this e-mail are those of the
> >> individual
> >> > sender except where they are stated to be the views of RDF Group plc.
> >> All
> >> > messages passing through this gateway are virus scanned.
> >> >
> >> >
> >> >
> >>
> >>
> >> --
> >> Cheers,
> >> Guillaume Nodet
> >>
> >
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> >
> >
>
> --
> View this message in context: http://www.nabble.com/Servicemix-http-configuring-soapAction-and-locationURI-dynamically-tf2064314.html#a6303678
> Sent from the ServiceMix - User forum at Nabble.com.
>
>
--
Cheers,
Guillaume Nodet