You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by Arunachalam Parthasarathy <ar...@gmail.com> on 2008/08/26 20:37:34 UTC

tuscany sca native and SDO C++ ?

hello,

i would like to know about the community of tuscany - sca - c++

please let me know, if this project is active!!

thanks,
Arunachalam

Re: Re: Does tuscany supply API which could use xml-like description to invoke sca component's service?

Posted by xuhongbo <xu...@tongtech.com>.
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:enjoyjava@gmail.com] 
Date: 2008/8/28/ 1:14
To: dev@tuscany.apache.org
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" <xu...@tongtech.com>
Sent: Wednesday, August 27, 2008 4:19 AM
To: <de...@tuscany.apache.org>
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.
>
>
>
 



Re: 答复: Does tuscany supply API which could use xml-like description to invoke sca component's service?

Posted by Raymond Feng <en...@gmail.com>.
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" <xu...@tongtech.com>
Sent: Wednesday, August 27, 2008 4:19 AM
To: <de...@tuscany.apache.org>
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:simonslaws@googlemail.com]
> 发送时间: 2008年8月27日 17:50
> 收件人: dev@tuscany.apache.org
> 主题: 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 <xu...@tongtech.com> 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
>
> 

答复: Does tuscany supply API which could use xml-like description to invoke sca component's service?

Posted by xuhongbo <xu...@tongtech.com>.
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:simonslaws@googlemail.com] 
发送时间: 2008年8月27日 17:50
收件人: dev@tuscany.apache.org
主题: 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 <xu...@tongtech.com> 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



Re: Does tuscany supply API which could use xml-like description to invoke sca component's service?

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Aug 27, 2008 at 8:19 AM, xuhongbo <xu...@tongtech.com> 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

Re: if two composite contribut to same scaDomain, both contain a component whose name is same, how could I choice the differnent component's service?

Posted by Simon Laws <si...@googlemail.com>.
On Wed, Aug 27, 2008 at 8:06 AM, xuhongbo <xu...@tongtech.com> wrote:

> Hello,
>        The sca assembly model v100 defined the component's name should be
> unique across all the components in the composite. But different composite
> may occasionally contain  component whose name is same;
>        So if I contribute such two different composite to one scaDomain,
> how could I choice the two different component whose name is same, but
> reside in two different composite?
>
>        ScaDomain.getService() is not applicable, yet, as it's only required
> component name ,and doesn't require any argument to distinguish composite
>
>        Etc:
>        ScaDomain.newInstance(domainUri, contextRoot,
> "CompositeA.composite", "CompositeB.composite");
>        ScaDomain.getService(UniqueService.class, "Unique") //which
> composite's "unique" component?
>
>        CompositeA.composite:
>
>        <composite name="CompositeA" .>
>                <component name="Unique" .>
>                </component>
>                ..
>        </composite>
>
>        CompositeB.composite:
>
>        <composite name="CompositeA" .>
>                <component name="Unique" .>
>                </component>
>                ..
>        </composite>
>
>
>
>
>
You should consider that in order to enable 2 separate composites they need
to be contributed to the domain in some way. For example,

1 - composites contributed as deployable
2 - included in other composites that are included as deployable composites
3 - named as component implementations using implementation.composite

In cases 1 and 2 the composite is flattened out and become part of another
composite (in case 1 this other composite is the virtual domain composite).
The component name must be unique in this context.

Simon

if two composite contribut to same scaDomain, both contain a component whose name is same, how could I choice the differnent component's service?

Posted by xuhongbo <xu...@tongtech.com>.
Hello,
	The sca assembly model v100 defined the component's name should be
unique across all the components in the composite. But different composite
may occasionally contain  component whose name is same;
	So if I contribute such two different composite to one scaDomain,
how could I choice the two different component whose name is same, but
reside in two different composite?
	
	ScaDomain.getService() is not applicable, yet, as it's only required
component name ,and doesn't require any argument to distinguish composite

	Etc:
	ScaDomain.newInstance(domainUri, contextRoot,
"CompositeA.composite", "CompositeB.composite");
	ScaDomain.getService(UniqueService.class, "Unique") //which
composite's "unique" component?

	CompositeA.composite:

	<composite name="CompositeA" .>
		<component name="Unique" .>
		</component>
		..
	</composite>

	CompositeB.composite:

	<composite name="CompositeA" .>
		<component name="Unique" .>
		</component>
		..
	</composite>
	
	 



Does tuscany supply API which could use xml-like description to invoke sca component's service?

Posted by xuhongbo <xu...@tongtech.com>.
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