You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by sunny <su...@xiancaro.com> on 2010/08/11 11:51:32 UTC

Integrate two application via servicemix

Hi all,

I want to integrate two application via ServiceMix.

There are two application A and B,both of them exposed web-service interface
for external applications.
I want to integrate them,Example:create a product in application A,Then
expect this product is created automatically in application B.How to do?

Now I have created two CXF BC to bind service of application A and B.

I imagine send a request message to bc(this bc for receiving
message,http-bc),then create a se to transform and route message(route
message to A-bc/B-BC).
or send a request message to one of application bc(A-bc) directly,then
transform it and route it to another one(B-bc) through se.

Is my work-flow right?

I am a newcomer of servicemix,hope someone's help,Thanks!

Regards,
sunny
-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Integrate-two-application-via-servicemix-tp2471683p2471683.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Integrate two application via servicemix

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

My comment inline.
On 2010-8-11, at 下午5:51, sunny wrote:

>
> Hi all,
>
> I want to integrate two application via ServiceMix.
>
> There are two application A and B,both of them exposed web-service  
> interface
> for external applications.
> I want to integrate them,Example:create a product in application  
> A,Then
> expect this product is created automatically in application B.How to  
> do?
>
> Now I have created two CXF BC to bind service of application A and B.
>
> I imagine send a request message to bc(this bc for receiving
> message,http-bc),then create a se to transform and route message(route
> message to A-bc/B-BC).
This flow is  more reasonable IMO.
So the flow looks like

client ----> http-bc-consumer(or cxf-bc-consumer)--->a se to route  
message(you can use smx-camel[1] or smx-eip[2] here)------->cxf bc  
provider1--->external application A
																													------->cxf bc provider2---> external  
application B

[1]http://servicemix.apache.org/servicemix-camel.html
[2]http://servicemix.apache.org/servicemix-eip.html

Freeman

> or send a request message to one of application bc(A-bc) directly,then
> transform it and route it to another one(B-bc) through se.
>
> Is my work-flow right?
>
> I am a newcomer of servicemix,hope someone's help,Thanks!
>
> Regards,
> sunny
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/Integrate-two-application-via-servicemix-tp2471683p2471683.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: Integrate two application via servicemix

Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Sunny,

Yes, your workflow is correct.

You will have a CXF-BC acting as a consumer that get incoming WebService 
request. The target service of this CXF-BC is a SE (for exemple 
saxon-xslt or bean) that transforms the message. This endpoint targets 
another CXF BC acting as a provider.

Regards
JB

On 08/11/2010 11:51 AM, sunny wrote:
>
> Hi all,
>
> I want to integrate two application via ServiceMix.
>
> There are two application A and B,both of them exposed web-service interface
> for external applications.
> I want to integrate them,Example:create a product in application A,Then
> expect this product is created automatically in application B.How to do?
>
> Now I have created two CXF BC to bind service of application A and B.
>
> I imagine send a request message to bc(this bc for receiving
> message,http-bc),then create a se to transform and route message(route
> message to A-bc/B-BC).
> or send a request message to one of application bc(A-bc) directly,then
> transform it and route it to another one(B-bc) through se.
>
> Is my work-flow right?
>
> I am a newcomer of servicemix,hope someone's help,Thanks!
>
> Regards,
> sunny

Re: Integrate two application via servicemix

Posted by Freeman Fang <fr...@gmail.com>.
Hi,

My comment inline.
On 2010-8-12, at 下午5:10, sunny wrote:

>
> Hi,
>
> Thank you!
>
> and Freeman,
>
> according to your suggestion,if i use cxf-bc-consumer,how to set the
> attribute "wsdl"?it points to a wsdl file,i don't know how to create  
> this
> wsdl(I know if cxf-bc-consumer target service is cxf-bc- 
> provider,this wsdl
> is the same as provider's wsdl).
It's all depend on your logic in transform se. I think you can create  
a wsdl which define all common base for both providers, then in your  
transform se you can customize the message for different  providers.
> and there are two providers(applications),i need to send message  
> request to
> them.but the messages are different(different attributes/ 
> parameter).should
> transform the message(that is sent from client) in se,right?
right.
> the message in client,how to write?
Well, you need define the wsdl between your cxf bc consumer and  
client, then use some tool like apache cxf wsdl2java to generate  
client side code stub, then use this stub to send request message.

Freeman
>
> I am puzzled!
>
> Regards,
> sunny
>
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/Integrate-two-application-via-servicemix-tp2471683p2473019.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: Integrate two application via servicemix

Posted by sunny <su...@xiancaro.com>.
Hi,

Thank you!

and Freeman,

according to your suggestion,if i use cxf-bc-consumer,how to set the
attribute "wsdl"?it points to a wsdl file,i don't know how to create this
wsdl(I know if cxf-bc-consumer target service is cxf-bc-provider,this wsdl
is the same as provider's wsdl).
and there are two providers(applications),i need to send message request to
them.but the messages are different(different attributes/parameter).should
transform the message(that is sent from client) in se,right?
the message in client,how to write?

I am puzzled!

Regards,
sunny

-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Integrate-two-application-via-servicemix-tp2471683p2473019.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.

Re: Integrate two application via servicemix

Posted by Freeman Fang <fr...@gmail.com>.
On 2010-8-16, at 下午5:23, sunny wrote:

>
> Hi,
>
>
>
>> I think you can create a wsdl which define all common base for both
>> providers, then in your
>> transform se you can customize the message for different  providers.
>>
>
> Do you mean merge the two wsdl files(providers' wsdl)?
>
> Can I make cxf-bc-consumer including the two wsdl and configure
> cxf-bc-consumer xbean.xml as follow:
>
> <beans xmlns="http://www.springframework.org/schema/beans"
>       xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
>       ...
>       xmlns:ws="targetNamespace A"
>       xmlns:wsn="targetNamespace B">
>
>  <cxfbc:consumer wsdl="classpath:A-Service.wsdl"
>                 service="ws:A-ServiceProxy"
>                 endpoint="A-HttpPortProxy"
>                 targetService=""
>                 targetEndpoint="" />
>
>  <cxfbc:consumer wsdl="classpath:B-Service.wsdl"
>                service="wsn:B-ServiceProxy"
>                endpoint="B-HttpPortProxy"
>                targetService=""
>                targetEndpoint=""/>
>  </beans>
>
> their targetService is SE.

This is ok

Freeman
>
> Regards,
> sunny
>
>
>
> -- 
> View this message in context: http://servicemix.396122.n5.nabble.com/Integrate-two-application-via-servicemix-tp2471683p2636483.html
> Sent from the ServiceMix - User mailing list archive at Nabble.com.


-- 
Freeman Fang

------------------------
Open Source SOA: http://fusesource.com
Apache Servicemix:http://servicemix.apache.org
Apache Cxf: http://cxf.apache.org
Apache Karaf: http://karaf.apache.org
Apache Felix: http://felix.apache.org


Re: Integrate two application via servicemix

Posted by sunny <su...@xiancaro.com>.
Hi,



> I think you can create a wsdl which define all common base for both
> providers, then in your  
> transform se you can customize the message for different  providers. 
> 

Do you mean merge the two wsdl files(providers' wsdl)?

Can I make cxf-bc-consumer including the two wsdl and configure
cxf-bc-consumer xbean.xml as follow:

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:cxfbc="http://servicemix.apache.org/cxfbc/1.0"
       ...
       xmlns:ws="targetNamespace A"
       xmlns:wsn="targetNamespace B">

  <cxfbc:consumer wsdl="classpath:A-Service.wsdl"
                 service="ws:A-ServiceProxy"
                 endpoint="A-HttpPortProxy"
                 targetService=""
                 targetEndpoint="" />
  
  <cxfbc:consumer wsdl="classpath:B-Service.wsdl"
                service="wsn:B-ServiceProxy"
                endpoint="B-HttpPortProxy"
                targetService=""
                targetEndpoint=""/>
  </beans>

their targetService is SE.

Regards,
sunny



-- 
View this message in context: http://servicemix.396122.n5.nabble.com/Integrate-two-application-via-servicemix-tp2471683p2636483.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.