You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Asha AmbikaVijayakumaran <as...@sat-path.com> on 2007/06/20 21:22:41 UTC

Accessing c++ service from java

Dear team,
   
  I am having a c++ service component eg:Account Service from your examples, the service is exposed via ws binding, and now i need this service to be accessed from java using apache tuscany,
   
  I have written a composite and i have attached it here.
   
  I am getting following exceptions
   
  Composite assembly problem: Reference not found for component reference: HelloWorldServiceComponent/accountService
Composite assembly problem: No type specified on component property: HelloWorldServiceComponent/accountService
Composite assembly problem: Component reference target not found: AccountService
   
  Can anyone help me to find out a solution how c++ service can be used in java.
  I am toubling to find a solution.
   
  Please help
   
  Thanks/Regards
  Asha
  




Re: Accessing c++ service from java

Posted by Jean-Sebastien Delfino <js...@apache.org>.
Asha AmbikaVijayakumaran wrote:
> Dear team,
>  
> I am having a c++ service component eg:Account Service from your 
> examples, the service is exposed via ws binding, and now i need this 
> service to be accessed from java using apache tuscany,
>  
> I have written a composite and i have attached it here.
>  
> I am getting following exceptions
>  
> Composite assembly problem: Reference not found for component 
> reference: HelloWorldServiceComponent/accountService
> Composite assembly problem: No type specified on component property: 
> HelloWorldServiceComponent/accountService
> Composite assembly problem: Component reference target not found: 
> AccountService
>  
> Can anyone help me to find out a solution how c++ service can be used 
> in java.
> I am toubling to find a solution.
>  
> Please help
>  
> Thanks/Regards
> Asha
>
>
>
Hi, you probably just need a minor fix to your composite file and maybe 
a small change to your Java class as well.

A component/reference does not need a target attribute if it's promoted 
by a composite/reference.

If present, a component/reference target should reference another 
component/service.

You don't need an accountService component/reference element anyway if 
the reference is already declared with an @Reference annotation in your 
HelloWorldServiceComponent class.

But from the "No type specified on component property: 
HelloWorldServiceComponent/accountService" message I'm guessing that 
maybe it's not annotated or annotated with an @Property instead?

So I'd suggest the following.

1. Change your composite as follows:

<composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
    targetNamespace="http://helloworld"
    xmlns:hw="http://helloworld"
    name="helloworldwsclient">
   
    <component name="HelloWorldServiceComponent">
      <implementation.java class="helloworld.HelloWorldServiceComponent"/>
   </component>

    <reference name="HelloWorldService" 
promote="HelloWorldServiceComponent/helloWorldService">
        <interface.java interface="helloworld.HelloWorldService" />
        <binding.ws 
wsdlElement="http://helloworld#wsdl.port(HelloWorldService/HelloWorldSoapPort)"/>
    </reference>

 <reference name="AccountService" 
promote="HelloWorldServiceComponent/accountService">
        <interface.wsdl 
interface="http://www.bigbank.com/AccountService#wsdl.interface(AccountService)"/>
    <binding.ws 
wsdlElement="http://www.bigbank.com/AccountService#wsdl.port(AccountService/AccountServiceSOAP)"/>
 </reference>

</composite>

2. Make sure that your HelloWorldServiceComponent annotates the 
accountService field or setter method with an @Reference annotation.

Hope this helps.

-- 
Jean-Sebastien


---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-user-help@ws.apache.org