It seems that you are trying to develop a gateway which can dynamically dispatch calls to SCA components.

Let's assume that you have the component/service/operation names and input data extracted from the incoming message. Can you pass in the java interface as well? If not, one idea could be that we use the interface on the SCA service if you pass in the class as something like Object.class:

SCAClient client; ....
Object service = client.getService(Object.class, "mycomponent/myservice");

Then use reflection APIs to invoke the operation against the service

If we think it's a good idea to enable reflective SCA invocations this way, we can bring it to the attention to the SCA spec group.

Thanks,
Raymond

--------------------------------------------------
From: "xuhongbo" <[EMAIL PROTECTED]>
Sent: Wednesday, August 27, 2008 4:19 AM
To: <[email protected]>
Subject: 答复: Does tuscany supply API which could use xml-like description to invoke sca component's service?

Hi,

My situation is write a proxy like program , this proxy received a soap-like-request and invoke sca component’s service by the soap request. And the proxy should not assume the sca component’s implement ,interface and binding; and let the sca component works as it’s original sca-design proposal.

Here is some reason, why we need such a proxy like program
1) in sca, only service with a ws.binding could be access through a soap request, but web-service need the protocol binding(http , jms, and some others..).. But we should not ask for all component to add a ws.binding just for correlate with proxy. Only the user does want to deploy a sca-service as a web-service for his own business proposal, he need use a binding.ws;

2) we has already has a system always generate a soap like request to invoke dynamic service deployed in the system. And the system exchange the soap-like-request using our build-in communication mechanism. And now we want to add a proxy to correlate with the system, using the proxy we could mapping the system’s dynamic service to SCA Component. So we will achieve the virtue of sca programming model to extend the service;


At first I just write a very simple sample proxy, in this sample, it run independency and create a domain from a composite. And the sample doesn’t assume how much component reside in the composite, and also doesn’t assume the component’s implement and interface; and I meet a problem that while using Tuscany api to access sca-component , I should provide a static java interface class. This is not allowed in this sample proxy; and my will illustrated as following:

Etc to inoke AddComponent's AddService
< composite name=" Calculator">
<component name="addComponent">
<implementation.java class="calculator.AddServiceImpl"/>
.......
<>
Tuscany: scaDomain.getService(AddService.class, "addComponent").add(1,2);
My will:
while received a soap-like-request
<soap:Header>
<ws:To>addComponent</ws:To>
<soap:header>
<body>
<add>
<arg0>1</arg0>
<arg1>1</arg1>
</add>
</body>
//assume soap-request will always be document-wrapped/rcp style
Service service = soapDomain.getServiceReference("interface.wsdl",soapHeader.getTo());
If(service != null){
Operation operation = service.getOperation(soapBody.getFirstElement().getElementName());
if(operation != null)
operation.invoke(soapBody.getFirstElement().getChildElements().toArray());
}



While the sample will run independent, but the real proxy may connect to node manager and take part in the sca domain;And how to operate with Tuscany node , I hasn’t concern it yet.






________________________________________
发件人: Simon Laws [mailto:[EMAIL PROTECTED]
发送时间: 2008年8月27日 17:50
收件人: [email protected]
主题: Re: Does tuscany supply API which could use xml-like description to invoke sca component's service?


On Wed, Aug 27, 2008 at 8:19 AM, xuhongbo <[EMAIL PROTECTED]> wrote:
Hello:
      Recently I meat a problem, that I should write a sca client program
which according to a dynamic xml description input to invoke the sca
component's service in a SCADomain?
      So does Tuscany support this feature  that could using xml-like
description to invoke service? Or is there any suggestion to me about how to
modify the source code of Tuscany to support this feature?

      Thanks to any suggestion



Hi Can you provide a little more detail about how you want your client to work, for example, is you client able to run a Tuscany node and take part in the SCA Domain or is it completely independent?

Simon


Reply via email to