You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Guillaume Nodet <gn...@gmail.com> on 2007/04/25 10:11:07 UTC

Re: questions about SE invokeing External Webservices

Just change the targetService of your consumer:
  targetService="tns:MyProviderService" targetEndpoint="myProvider"
and the JBI exchange will be sent to the http provider instead of
the hello SE.

On 4/24/07, yinwen fu <yw...@wiscom.com.cn> wrote:
>
>
> Hi,I'm newbie at servicemix.I am playing with servicemix 3.1-incubating.
> The execution flow will be httpclient -> http consumer -> SE  ->http
> provider -> external web service.
> Here is  my properties.
>    SA's jbi.xml:
>        <?xml version="1.0" encoding="UTF-8"?>
>       <jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
>      <service-assembly>
>     <identification>
>       <name>test</name>
>       <description>hhehehe</description>
>     </identification>
>     <service-unit>
>       <identification>
>         <name>first-http-su</name>
>         <description>ServiceMix is an open source ESB based on the Java
> Business
>     Integration framework - JSR-208</description>
>       </identification>
>       <target>
>         <artifacts-zip>first-http-su-3.1-incubating.zip</artifacts-zip>
>         <component-name>servicemix-http</component-name>
>       </target>
>     </service-unit>
>     <service-unit>
>       <identification>
>         <name>first-hello-word</name>
>         <description>ServiceMix is an open source ESB based on the Java
> Business
>     Integration framework - JSR-208</description>
>       </identification>
>       <target>
>         <artifacts-zip>helloword.zip</artifacts-zip>
>         <component-name>hello-world-se</component-name>
>       </target>
>     </service-unit>
>   </service-assembly>
> </jbi>
>
> first-http-su's xbean.xml
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>        xmlns:person="http://servicemix.apache.org/samples/wsdl-first"
>        xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0
> "
>        xmlns:tns="http://com.wiscom.is.webservice/Test">
>
>   <http:endpoint service="person:PersonService"
>                  endpoint="soap"
>                  role="consumer"
>                  locationURI="http://0.0.0.0:8193/PersonService/"
>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>                  targetService="hello:fyw"
>                  targetEndpoint="hello:fywendpoint"/>
>   <http:endpoint service="tns:MyProviderService"
>                  endpoint="myProvider"
>                  role="provider"
>                  locationURI="http://localhost:8080/test/services/Test"
>
> wsdlResource="http://localhost:8080/test/services/Test?wsdl" />
> </beans>
>
> first-hello-word's xbean.xml
> <beans xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0
> "
>        xmlns:tns="http://com.wiscom.is.webservice/Test">
>        <hello:endpoint service="hello:fyw" endpoint="fywendpoint"/>
> </beans>
>
>
>   The flow  httpclient -> http consumer -> SE   works well.I need to know
> how to
> configure servicemix for  SE invokeing the External Webservices?
>
> Thanks for your help,
>
> --
> View this message in context:
> http://www.nabble.com/questions-about--SE-invokeing-External-Webservices-tf3635738s12049.html#a10152567
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


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

Re: questions about SE invokeing External Webservices

Posted by Guillaume Nodet <gn...@gmail.com>.
On 4/27/07, yinwen fu <yw...@wiscom.com.cn> wrote:
>
>
>
> first sorry for my poor English express ability.I still have two
> questions:
>      1. If I wirte a full SE,Can the SE act as both consumer and
> provider?In other words,the SE receives the message and does some logic
> itself  ,finally  the SE routes  the message to the final provider.For
> example, Once the SE receive the message from httpconsumer bc,it log
> something ,and then route the message to a http provier pc.


Sure, Take a look at servicemix-eip.  Generally, routers will act as both a
provider
and a consumer.

     2.if there are several External Webservices  , I assume there shuold be
> several http provider bc.
> Can one http consumer bc route the massage to the  correct  provider bc by
> different operation?
> if not,What should  the correct frame be?


You can use an existing router such as those defined by servicemix-eip,
or implement your own if needed.  You can do nearly whatever you want when
transforming the incoming message and before routing it.

--
> View this message in context:
> http://www.nabble.com/questions-about--SE-invokeing-External-Webservices-tf3635738s12049.html#a10211916
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


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

Re: questions about SE invokeing External Webservices

Posted by yinwen fu <yw...@wiscom.com.cn>.

first sorry for my poor English express ability.I still have two questions:
     1. If I wirte a full SE,Can the SE act as both consumer and 
provider?In other words,the SE receives the message and does some logic 
itself  ,finally  the SE routes  the message to the final provider.For
example, Once the SE receive the message from httpconsumer bc,it log
something ,and then route the message to a http provier pc. 

     2.if there are several External Webservices  , I assume there shuold be
several http provider bc.
Can one http consumer bc route the massage to the  correct  provider bc by 
different operation?
if not,What should  the correct frame be?
-- 
View this message in context: http://www.nabble.com/questions-about--SE-invokeing-External-Webservices-tf3635738s12049.html#a10211916
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: questions about SE invokeing External Webservices

Posted by Guillaume Nodet <gn...@gmail.com>.
It depends what you mean by hard coded ;-)
They are not in the java code but in the xml configuration file, so you can
easily
change them.  But if you mean that you won't be able to change them at
runtime,
that's true, but JBI does not offer any way to do that (you could always
expose
a bean through JMX to change the values dynamically though).
As for the actual class to use, it depends on your needs.  You can either
create a
full SE and deploy service units onto it and you would write a Component
by extending DefaultComponent and an endpoint by inheriting
ProviderEndpoint.
If you don't need to write a full SE, you could leverage servicemix-bean,
servicemix-jsr181 or write a lightweight component.

On 4/26/07, yinwen fu <yw...@wiscom.com.cn> wrote:
>
>
> Does this mean I should hard-code  to implement the message route?Which
> class
> should my hello SE  extend?TransformComponent and SimpleEndpoint?
>
>
> gnodet wrote:
> >
> > Well, it's up to your own component to create and send JBI exchanges
> then
> > ...
> > You can configure the target as properties on your endpoints and use
> them
> > when sending exchanges.
> >
>
> --
> View this message in context:
> http://www.nabble.com/questions-about--SE-invokeing-External-Webservices-tf3635738s12049.html#a10192570
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


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

Re: questions about SE invokeing External Webservices

Posted by yinwen fu <yw...@wiscom.com.cn>.
Does this mean I should hard-code  to implement the message route?Which class
should my hello SE  extend?TransformComponent and SimpleEndpoint?


gnodet wrote:
> 
> Well, it's up to your own component to create and send JBI exchanges then
> ...
> You can configure the target as properties on your endpoints and use them
> when sending exchanges.
> 

-- 
View this message in context: http://www.nabble.com/questions-about--SE-invokeing-External-Webservices-tf3635738s12049.html#a10192570
Sent from the ServiceMix - User mailing list archive at Nabble.com.


Re: questions about SE invokeing External Webservices

Posted by Guillaume Nodet <gn...@gmail.com>.
Well, it's up to your own component to create and send JBI exchanges then
...
You can configure the target as properties on your endpoints and use them
when sending exchanges.

On 4/25/07, yinwen fu <yw...@wiscom.com.cn> wrote:
>
>
>
> Thanks for your reply.But I assume the  flow is httpclient -> http
> consumer
> -> the hello SE  ->http
> > provider -> external web service.
>
> gnodet wrote:
> >
> > Just change the targetService of your consumer:
> >   targetService="tns:MyProviderService" targetEndpoint="myProvider"
> > and the JBI exchange will be sent to the http provider instead of
> > the hello SE.
> >
> > On 4/24/07, yinwen fu <yw...@wiscom.com.cn> wrote:
> >>
> >>
> >> Hi,I'm newbie at servicemix.I am playing with servicemix 3.1-incubating
> .
> >> The execution flow will be httpclient -> http consumer -> SE  ->http
> >> provider -> external web service.
> >> Here is  my properties.
> >>    SA's jbi.xml:
> >>        <?xml version="1.0" encoding="UTF-8"?>
> >>       <jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
> >>      <service-assembly>
> >>     <identification>
> >>       <name>test</name>
> >>       <description>hhehehe</description>
> >>     </identification>
> >>     <service-unit>
> >>       <identification>
> >>         <name>first-http-su</name>
> >>         <description>ServiceMix is an open source ESB based on the Java
> >> Business
> >>     Integration framework - JSR-208</description>
> >>       </identification>
> >>       <target>
> >>         <artifacts-zip>first-http-su-3.1-incubating.zip</artifacts-zip>
> >>         <component-name>servicemix-http</component-name>
> >>       </target>
> >>     </service-unit>
> >>     <service-unit>
> >>       <identification>
> >>         <name>first-hello-word</name>
> >>         <description>ServiceMix is an open source ESB based on the Java
> >> Business
> >>     Integration framework - JSR-208</description>
> >>       </identification>
> >>       <target>
> >>         <artifacts-zip>helloword.zip</artifacts-zip>
> >>         <component-name>hello-world-se</component-name>
> >>       </target>
> >>     </service-unit>
> >>   </service-assembly>
> >> </jbi>
> >>
> >> first-http-su's xbean.xml
> >> <?xml version="1.0" encoding="UTF-8"?>
> >> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
> >>        xmlns:person="http://servicemix.apache.org/samples/wsdl-first"
> >>
> >> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0
> >> "
> >>        xmlns:tns="http://com.wiscom.is.webservice/Test">
> >>
> >>   <http:endpoint service="person:PersonService"
> >>                  endpoint="soap"
> >>                  role="consumer"
> >>                  locationURI="http://0.0.0.0:8193/PersonService/"
> >>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
> >>                  targetService="hello:fyw"
> >>                  targetEndpoint="hello:fywendpoint"/>
> >>   <http:endpoint service="tns:MyProviderService"
> >>                  endpoint="myProvider"
> >>                  role="provider"
> >>                  locationURI="http://localhost:8080/test/services/Test"
> >>
> >> wsdlResource="http://localhost:8080/test/services/Test?wsdl" />
> >> </beans>
> >>
> >> first-hello-word's xbean.xml
> >> <beans
> >> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0
> >> "
> >>        xmlns:tns="http://com.wiscom.is.webservice/Test">
> >>        <hello:endpoint service="hello:fyw" endpoint="fywendpoint"/>
> >> </beans>
> >>
> >>
> >>   The flow  httpclient -> http consumer -> SE   works well.I need to
> know
> >> how to
> >> configure servicemix for  SE invokeing the External Webservices?
> >>
> >> Thanks for your help,
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/questions-about--SE-invokeing-External-Webservices-tf3635738s12049.html#a10152567
> >> Sent from the ServiceMix - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Guillaume Nodet
> > ------------------------
> > Principal Engineer, IONA
> > Blog: http://gnodet.blogspot.com/
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/questions-about--SE-invokeing-External-Webservices-tf3635738s12049.html#a10177038
> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>
>


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

Re: questions about SE invokeing External Webservices

Posted by yinwen fu <yw...@wiscom.com.cn>.

 Thanks for your reply.But I assume the  flow is httpclient -> http consumer
-> the hello SE  ->http 
> provider -> external web service.

gnodet wrote:
> 
> Just change the targetService of your consumer:
>   targetService="tns:MyProviderService" targetEndpoint="myProvider"
> and the JBI exchange will be sent to the http provider instead of
> the hello SE.
> 
> On 4/24/07, yinwen fu <yw...@wiscom.com.cn> wrote:
>>
>>
>> Hi,I'm newbie at servicemix.I am playing with servicemix 3.1-incubating.
>> The execution flow will be httpclient -> http consumer -> SE  ->http
>> provider -> external web service.
>> Here is  my properties.
>>    SA's jbi.xml:
>>        <?xml version="1.0" encoding="UTF-8"?>
>>       <jbi xmlns="http://java.sun.com/xml/ns/jbi" version="1.0">
>>      <service-assembly>
>>     <identification>
>>       <name>test</name>
>>       <description>hhehehe</description>
>>     </identification>
>>     <service-unit>
>>       <identification>
>>         <name>first-http-su</name>
>>         <description>ServiceMix is an open source ESB based on the Java
>> Business
>>     Integration framework - JSR-208</description>
>>       </identification>
>>       <target>
>>         <artifacts-zip>first-http-su-3.1-incubating.zip</artifacts-zip>
>>         <component-name>servicemix-http</component-name>
>>       </target>
>>     </service-unit>
>>     <service-unit>
>>       <identification>
>>         <name>first-hello-word</name>
>>         <description>ServiceMix is an open source ESB based on the Java
>> Business
>>     Integration framework - JSR-208</description>
>>       </identification>
>>       <target>
>>         <artifacts-zip>helloword.zip</artifacts-zip>
>>         <component-name>hello-world-se</component-name>
>>       </target>
>>     </service-unit>
>>   </service-assembly>
>> </jbi>
>>
>> first-http-su's xbean.xml
>> <?xml version="1.0" encoding="UTF-8"?>
>> <beans xmlns:http="http://servicemix.apache.org/http/1.0"
>>        xmlns:person="http://servicemix.apache.org/samples/wsdl-first"
>>       
>> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0
>> "
>>        xmlns:tns="http://com.wiscom.is.webservice/Test">
>>
>>   <http:endpoint service="person:PersonService"
>>                  endpoint="soap"
>>                  role="consumer"
>>                  locationURI="http://0.0.0.0:8193/PersonService/"
>>                  defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
>>                  targetService="hello:fyw"
>>                  targetEndpoint="hello:fywendpoint"/>
>>   <http:endpoint service="tns:MyProviderService"
>>                  endpoint="myProvider"
>>                  role="provider"
>>                  locationURI="http://localhost:8080/test/services/Test"
>>
>> wsdlResource="http://localhost:8080/test/services/Test?wsdl" />
>> </beans>
>>
>> first-hello-word's xbean.xml
>> <beans
>> xmlns:hello="http://org.apache.servicemix.samples.helloworld.se/1.0
>> "
>>        xmlns:tns="http://com.wiscom.is.webservice/Test">
>>        <hello:endpoint service="hello:fyw" endpoint="fywendpoint"/>
>> </beans>
>>
>>
>>   The flow  httpclient -> http consumer -> SE   works well.I need to know
>> how to
>> configure servicemix for  SE invokeing the External Webservices?
>>
>> Thanks for your help,
>>
>> --
>> View this message in context:
>> http://www.nabble.com/questions-about--SE-invokeing-External-Webservices-tf3635738s12049.html#a10152567
>> Sent from the ServiceMix - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Guillaume Nodet
> ------------------------
> Principal Engineer, IONA
> Blog: http://gnodet.blogspot.com/
> 
> 

-- 
View this message in context: http://www.nabble.com/questions-about--SE-invokeing-External-Webservices-tf3635738s12049.html#a10177038
Sent from the ServiceMix - User mailing list archive at Nabble.com.