You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by lilas <kh...@hotmail.com> on 2007/06/05 15:12:18 UTC
Help with jsr181 proxy
Hi,
I am a newbie to ServiceMix world, and I don't understand how to internally
invoke a jsr181 POJO from another jsr181 POJO, I searched and found someting
about proxy. But I didn't understood it clearly. For example, I have a
jsr181 web service "hello", and another jsr181 web service "helloBackEnd"
both exposed via ServiceMix jsr181 SE. how can I code from a method inside
"hello" a call to "helloBackEnd" methods. Could you please explain to me how
to do that. I keep seeing the config part of the thing with "jsr181:proxy",
what about the coding part. Is there any complete example out there?
Thanks a lot.
Best regards
Lilas
--
View this message in context: http://www.nabble.com/Help-with-jsr181-proxy-tf3871686s12049.html#a10969148
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Help with jsr181 proxy
Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Lilas,
I have written a small example for this case. You can find it at:
http://www.liquid-reality.de/main/projects/servicemix
It is a fully running example of a pojo client calling a pojo service.
Please write back if it worked for you or if you have any suggestions
how to improve the sample.
Regards
Christian
lilas schrieb:
> Hi Bruce, thx for the reply. This is my basic xbean.xml file of my
> destination jsr181 service:
>
> <beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0">
>
> <classpath>
> <location>.</location>
> </classpath>
>
> <jsr181:endpoint pojoClass="org.servicemix.test.HelloImpl"
> wsdlResource="classpath:service.wsdl" />
>
>
> </beans>
>
>
> and this is a fragment of the Java code I wrote to forward a
> NormalizedMessage to the service implemented by
> org.servicemix.test.HelloImpl.
>
> EndpointDeliveryChannel channel;
>
>
> channel = (EndpointDeliveryChannel) context.getDeliveryChannel();
>
> ServiceEndpoint se = context.getEndpoint( new QName(reference),
> port);
>
> InOut exch = channel.createExchangeFactory(se).createInOutExchange();
>
>
> context.getDeliveryChannel().sendSync(exch);
>
> NormalizedMessage outMessage = exch.getOutMessage();
>
>
>
>
> 1- In the documentation I don't see any targetService/targetEndpoint in the
> properties of a jsr181 su xbean deployement file. Could you tell me how can
> I change my xbean to target the service above (I must implement
> MessageExchangeListner to process the message isn't it?).
>
> 2- In fact the scenario I have in my mind is the following :
>
> -call from an external soap client an operation from an exposed jsr181
> service via HTTP BC.
> -this operation should call another one defined in another jsr181 but
> without HTTP BC (internally)
>
> So how can I setup this?
>
> Thanks a lot.
>
> Regards,
>
> Khalil.
>
>
>
--
Christian Schneider
---
http://www.liquid-reality.de
Re: Help with jsr181 proxy
Posted by lilas <kh...@hotmail.com>.
Hi Bruce, thx for the reply. This is my basic xbean.xml file of my
destination jsr181 service:
<beans xmlns:jsr181="http://servicemix.apache.org/jsr181/1.0">
<classpath>
<location>.</location>
</classpath>
<jsr181:endpoint pojoClass="org.servicemix.test.HelloImpl"
wsdlResource="classpath:service.wsdl" />
</beans>
and this is a fragment of the Java code I wrote to forward a
NormalizedMessage to the service implemented by
org.servicemix.test.HelloImpl.
EndpointDeliveryChannel channel;
channel = (EndpointDeliveryChannel) context.getDeliveryChannel();
ServiceEndpoint se = context.getEndpoint( new QName(reference),
port);
InOut exch = channel.createExchangeFactory(se).createInOutExchange();
context.getDeliveryChannel().sendSync(exch);
NormalizedMessage outMessage = exch.getOutMessage();
1- In the documentation I don't see any targetService/targetEndpoint in the
properties of a jsr181 su xbean deployement file. Could you tell me how can
I change my xbean to target the service above (I must implement
MessageExchangeListner to process the message isn't it?).
2- In fact the scenario I have in my mind is the following :
-call from an external soap client an operation from an exposed jsr181
service via HTTP BC.
-this operation should call another one defined in another jsr181 but
without HTTP BC (internally)
So how can I setup this?
Thanks a lot.
Regards,
Khalil.
--
View this message in context: http://www.nabble.com/Help-with-jsr181-proxy-tf3871686s12049.html#a10984814
Sent from the ServiceMix - User mailing list archive at Nabble.com.
Re: Help with jsr181 proxy
Posted by Bruce Snyder <br...@gmail.com>.
On 6/5/07, lilas <kh...@hotmail.com> wrote:
>
>
> Hi,
>
> I am a newbie to ServiceMix world, and I don't understand how to internally
> invoke a jsr181 POJO from another jsr181 POJO, I searched and found someting
> about proxy. But I didn't understood it clearly. For example, I have a
> jsr181 web service "hello", and another jsr181 web service "helloBackEnd"
> both exposed via ServiceMix jsr181 SE. how can I code from a method inside
> "hello" a call to "helloBackEnd" methods. Could you please explain to me how
> to do that. I keep seeing the config part of the thing with "jsr181:proxy",
> what about the coding part. Is there any complete example out there?
Are you trying to route messages from the first servicemix-jsr181 SU
to the second servicemix-jsr181 SU? That is achieved via the xbean.xml
configuration by specifying the targetService attribute to specify the
namespace and service name of the second servicemix-jsr181 SU.
OR
Are you trying to write Java code in the POJOs that you are exposing
via the servicemix-jsr181 SU to initiate a message from the first
servicemix-jsr181 SU to the second servicemix-jsr181 SU? This can be
achieved by creating a normalized message and sending it the second
servicemix-jsr181 SU using the ServiceMix client API
(http://incubator.apache.org/servicemix/client-api.html) or simply by
using the exchange to get teh message and the delivery channel to send
the message.
Bruce
--
perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'
Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://activemq.org/
Apache ServiceMix - http://servicemix.org/
Castor - http://castor.org/