-
1. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
mageshbk Feb 26, 2013 7:50 AM (in response to felix_huangwenjie)Hi Felix,
Please use the latest version of SwitchYard, which is 0.7 and have a look at the camel-soap-proxy quickstart. To invoke an external service you need to use a reference binding on the bean component.
https://docs.jboss.org/author/display/SWITCHYARD/SOAP+Bindings
-
2. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
felix_huangwenjie Feb 26, 2013 1:11 PM (in response to mageshbk)Hi Magesth,
Thanks you for your quick reply.
I tried the reference binding and it did not work.
Right now, we are making a technical choose from Spring, SwitchYard and Tibco. So, we need to implement a POC SOA project using Switchyard. It would be really helpfully if you can offer a detailed demo.
Regards!
Felix
-
3. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
mageshbk Feb 26, 2013 11:10 PM (in response to felix_huangwenjie)Hi Felix,
Here is a set of videos that can get you started from scratch. You might see what you would have missed when adding a binding. Please post any feedback about the videos, thanks!
https://community.jboss.org/wiki/SwitchYardVideoSeries
In fact Episode 6 is exactly what you are looking for.
-
4. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
felix_huangwenjie Feb 27, 2013 1:25 AM (in response to mageshbk)Hi,
I have already see the all 6 vedios. Video 6 is kind of helpful for me, but it just mentioned you can invoke external web service using reference. But how to do that, what kind of interface should I choose, Java or WSDL? Should I promote that reference from bean component? How to invoke web service from Java bean, using @reference?
Please note that we are in the processing of screening products.I personally think Switchyard is a pretty cool one and that is why we are doing a POC using it. I can find a lot of document on how-to in other products, like Tibco, Spring. So, if I can not finish my POC process using switchyard, "Poor documentation and little support" are definitely among the facts I blame.
Regards!
Felix
-
5. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
mageshbk Feb 27, 2013 7:13 AM (in response to felix_huangwenjie)Hi Felix,
Please note that we are still in our infancy. We haven't released 1.0 yet . We are aiming to get a comprehensive feature/fixes with that release. In the meantime, here are some ideas.
But how to do that, what kind of interface should I choose, Java or WSDL?
You should choose a Java interface in your Bean component. Say, you have a Weather interface with getTemperature(Place place) method.
Should I promote that reference from bean component?
Yes the current GUI editor expects that. There are some issues in the tooling (that I noticed now) and will raise them appropriately with the team, meanwhile please edit the file in XML editor.
How to invoke web service from Java bean, using @reference?
This is a slightly tricky at the moment. As I said earlier, using Weather interface you can call directly the getTemperature(...) method. Now you will have to define Transformers to transform the messages to/from SOAP/Weather interface, that's it. Please raise any appropriate query with a simple sample of your project and giving details about the scenario. We will do our best to fix, is any issues, as soon as we can.
I guess you would have already read about the transformation feature in SwitchYard too https://docs.jboss.org/author/display/SWITCHYARD/Transformation
Thanks for trying out SwitchYard and your feedback really helps!
-
6. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
kcbabo Feb 27, 2013 9:03 AM (in response to felix_huangwenjie)Please note that we are in the processing of screening products.I personally think Switchyard is a pretty cool one and that is why we are doing a POC using it. I can find a lot of document on how-to in other products, like Tibco, Spring. So, if I can not finish my POC process using switchyard, "Poor documentation and little support" are definitely among the facts I blame.
I'm not sure how "little support" could be to blame considering you had a reply to your question within four hours of posting it here. In terms of documentation coverage, I think this topic is definitely a hole and will be addressed when we revamp our documentation structure after the 0.8. The Getting Started guide really needs to cover topics like your question to help new users understand the moving parts before going deeper into the details.
In the meantime, I can publish an example app in this thread a bit later today with some commentary on the why/how behind it.
-
7. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
felix_huangwenjie Feb 27, 2013 10:27 AM (in response to kcbabo)Hi Keith & Magesh,
Thx for your qucik response. I understand that switchyard is still in infancy and I really think it is a powerful and inclusive platform, so sincerely hope swithyard grow faster and stronger.
Hi Magesh,
Appreciate your honesty, looking forward to the example.
Good day!
Felix
-
8. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
kcbabo Feb 27, 2013 11:32 PM (in response to felix_huangwenjie)Just getting back to this now and hacked together a quick app based on the bean-service quickstart depicted here:
https://raw.github.com/jboss-switchyard/quickstarts/master/bean-service/bean-service.jpg
To demonstrate your use case, I moved the inventory service into a separate application and exposed it as a web service. I then modified the original bean-service composition to invoke the inventory service as an external web service. Check out the attached zip which contains an inventory-service and order-service application.
A few notes based on discussion earlier in the thread:- SwitchYard 0.5 is several months old. 0.7.0.Final is the current stable release and 0.8.0.Final will be out in the next two weeks. I suggest trying a more recent version than 0.5.
- There are transformers used in both applications since Bean services will use Java interfaces and SOAP endpoints will use WSDL interfaces - a transformation must occur for each request and response pair between XML and Java. Don't feel like you have to use Java if you would prefer to just handle XML. In that scenario, you could use a Camel route, BPMN 2 process, or BPEL to implement your service logic - all of these support WSDL as native contract type and can deal with XML directly. Don't want you to think that a transformer is required every time you deal with SOAP or XML in SwitchYard - it's just when you use Java contracts/interfaces for the consumer and WSDL interfaces for the provider (and vice versa).
- I think the term "infancy" is a bit relative here. We have not had our 1.0 release yet, so it's true the project is young and growing. That said, we have had seven Final releases in the community up to this point and we will be 1.0 not too long from now.
Thanks for your interest in SwitchYard and I hope you continue to play, learn, and provide feedback.
regards,
keith
-
9. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
kcbabo Feb 27, 2013 11:33 PM (in response to kcbabo)Whoops, here's the attachment.
-
sample.zip 104.3 KB
-
-
10. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
kcbabo Feb 27, 2013 11:37 PM (in response to kcbabo)BTW, I have not forgotten that original request was for a step-by-step guide on how to do this. I merely provided an example for now, but I'll see if I can shoot a video of this within the next week which will give you a feel for how it works.
-
11. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
felix_huangwenjie Mar 3, 2013 10:02 AM (in response to kcbabo)Hi Keith,
It works, thx for your support!
Felix
-
12. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
dmanibtech Apr 3, 2013 5:31 AM (in response to felix_huangwenjie)Hi,
Can anyone please guide us to learn more on calling external REST services in the same context of this thread.
My requirement is to call a external REST SY service from another SY service through bean component.
-
13. Re: Step-to-step guide on how to invoke external web service from a bean component in Switchyard 0.5
mageshbk Apr 3, 2013 7:40 AM (in response to dmanibtech)Hi Mani,
This is exactly what is showcased in rest-binding quickstart. Please let us know if you need further help after looking at that.
regards,
Magesh