Hi,
Welcome to Tuscany!
Let me first make sure that I understand your scenario correctly.
1) You have an external web service "MathService" developed with Axis2 and
the endpoint address is http://localhost:8080/zong/services/MathService.
2) In the Calculator composite, you want to wire to the "MathService" to
provide the "add" function
3) There is an interface AddService with "add" operation
Since the MathService has different operations than AddService, the
Calculator component needs to wire to the MathService using an interface
compatible with MathService, for example, you can define an interface for
the MathService as:
@Remotable
public interface RemoteMatchService {
public double addiere(double a,double b);
public int aufrunden(double a);
}
And change the Calculator impl to be:
private RemoteMatchService addService;
@Reference
public void setAddService(RemoteMathService addService) {
...
}
public double add(double n1, double n2) {
return addService.addiere(n1, n2);
}
Thanks,
Raymond
--------------------------------------------------
From: "Albert Rainer" <[EMAIL PROTECTED]>
Sent: Friday, March 21, 2008 5:53 AM
To: <[email protected]>
Subject: WS outside of control
I'm giving a lecture in "Web Service Composition" at the Vienna University
of Technology and I want to use tuscany as an advances technique for
system configuration. But first of all I've to understand the technology
befor annoying my students. I've gone through the examples but didn't find
any solution for my problem.
:
I have a composite that defines a component and binds it to a Web Service
outside of my control, somewhere on the Web.
The service is axis2 and generated from a Java class.
package at.move;
public class MathService {
public double addiere(double a,double b){
return a+b;
}
public int aufrunden(double a){
return (int)Math.ceil(a);
}
}
The Calculaor.composite looks like that:
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
targetNamespace="http://sample"
xmlns:sample="http://sample"
name="Calculator">
<component name="CalculatorServiceComponent">
<implementation.java class="calculator.CalculatorServiceImpl"/>
<reference name="addService">
<binding.ws
uri="http://localhost:8080/zong/services/MathService" />
</reference>
<reference name="subtractService"
target="SubtractServiceComponent"></reference>
<reference name="multiplyService"
target="MultiplyServiceComponent"></reference>
<reference name="divideService"
target="DivideServiceComponent"></reference>
</component>
<component name="SubtractServiceComponent">
<implementation.java class="calculator.SubtractServiceImpl"/>
</component>
...
</composite>
The idea is: For the addService and method add() I want to use the The Web
Service with the method: addiere()
I need to map the AddService to the MathService and the add method from
the Calculator to the addiere method from MathService
@Reference
public void setAddService(AddService addService) {
this.addService = addService;
}
public double add(double n1, double n2) {
return addService.add(n1, n2);
}
What steps are required in order to achieve such a mapping? Or is this not
in the intetntion of tuscany and it is not possible?
Many thanks in advance.
----------------------------------------------------------------
Dr. Albert Rainer
EC3 - Electronic Commerce Competence Center
www.ec3.at
Donau-City Strasse 1
A-1220 Wien
Tel: +43 1 522 71 71 - 33
Fax: +43 1 522 71 71 - 71
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]