Thanks Raymond:
        Reflecting SCA invocation is a good idea. By this way, I just need
to do additional work to convert the soap-message to java-object , then I
could invoke the sca-component dynamically.

        And I noticed Tuscany provided api could get Java-Interface for all
service, no matter the sca service 's interface is interface.java or
interface.wsdl , Tuscany could map a java-interface to the service's real
interface, while invoking the java-interface; 
        So I think, if Tuscany could provide a api which could get
WSDL-Interface for all service, no matter the service's interface is java or
wsdl, and also Tuscany could map the wsdl-interface to service's real
interface, while invoke the wsdl-interface;
        In the previouse post sample, I hasn't described my thought clearly.
And maybe It seems like :
        WSDLService service = scaDomain.getService("interface.wsdl",
serviceName);
        WSDLOperationClient op = service.getOperationContext(opName);
        op.invoke(soapAxiomArgs);

Thanks

-----Original -----
From: Raymond Feng [mailto:[EMAIL PROTECTED] 
Date: 2008/8/28/ 1:14
To: [email protected]
Subject: Re:Re: Does tuscany supply API which could use xml-like description
to invoke sca component's service?

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.
>
>
>
 


Reply via email to