-
1. Re: How to invoke external web service???
jorgemoralespou_2 Apr 22, 2015 10:46 AM (in response to nello360)Hi Nello,
What do you mean with edit the output in your switchyard service?
This scenario that you describe is the normal:
Create a switchayrd app with:
- A composite service that you'll use to invoke the service (can be the same as the end service or a different one)
- A component. Camel or Java component, but depending on your selection, you'll have to work in a different maner, using Java, and @Reference annotations to the reference, or just a to("switchyard://YourCompositeReference")
- A composite reference that will consume the end service, and where you'll configure the backend endpoint.
I recommend you to read the docs (to settle the concepts), and play with the quickstarts, specially with this one: https://github.com/jboss-switchyard/quickstarts/tree/master/camel-soap-proxy
Hope it helps,
-
2. Re: How to invoke external web service???
nello360 Apr 22, 2015 11:43 AM (in response to jorgemoralespou_2)with edit the output, I mean, for example, that if the external service return a string (such as "100"), my service concats another string (such as "C" , then my service will return "100 C")
this is what i did...
I have an external soap web service that converts the temperature and return the result
my bean cosnume the service and concat the result; the bean is promoted as a web service.
I did my bean like this:
import javax.inject.Inject; import org.switchyard.component.bean.Reference; import org.switchyard.component.bean.Service; @Service(MyConvert.class) public class MyConvertBean implements MyConvert { @Reference @Inject TempConvertSoap t; @Override public String converti(String temp) { // TODO Auto-generated method stub String result = t.CelsiusToFahrenheit(temp)+ " F"; System.out.println("ok"); return result; } }
but it does not work...It is correct or I have done somethig wrong?
I hope I have been clearer now.
thanks for all
-
3. Re: How to invoke external web service???
jorgemoralespou_2 Apr 23, 2015 3:02 AM (in response to nello360)Hi Nello,
This is fine, as long as you have converters properly defined.
Your external service is wsdl (with XML elements as parameters), your component interface is Java with a String as parameters, so as long as you convert everything properly, this should work.
Check this:
http://unpoucode.blogspot.se/2014/10/switchyard-contracts.html
https://docs.jboss.org/author/display/SWITCHYARD11/Transformers
Hope it helps,
-
4. Re: How to invoke external web service???
nello360 Apr 23, 2015 6:41 AM (in response to jorgemoralespou_2)thank's!!!
I had a problem with the transformer!
Bye