You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Travis Vitek <tv...@quovadx.com> on 2007/07/01 10:31:15 UTC

RE: invoking a non-c++ service from c++

I'm using the Calculator example services. I setup a batch file to run
each client implementation against each service implementation. Before
running a client, I set the TUSCANY_SCACPP_ROOT environment variable. I
can provide that batch file if you'd like.

Travis

-----Original Message-----
From: Pete Robbins

Hi Travis. Could you post your .composite and .comonentType files
please. There may be a restriction of calling a Ruby component directly
from a C++ client... I'd need to check. Have you tried having the client
call initially into a C++ component which then invokes the Ruby
component?

Cheers,

On 30/06/07, Travis Vitek <tv...@quovadx.com> wrote:
>
> I've been playing with Tuscany SCA for a few days and I've run into 
> something that I believe should work but does not. As the subject 
> indicates, I'm trying to invoke a local non-c++ service from a c++ 
> client via Tuscany SCA Native. I've scoured the documentation and 
> haven't seen anything indicating that this is a known limitation, 
> perhaps I'm doing something wrong?
>
> Here is the output I get when running the C++ client against a ruby 
> service.
>
>        calculator_client: exception caught: Exception
>         Class:           SystemConfigurationException
>         Description:     Unable to load library:
> C:\build\tuscany\tuscany_sca_native-1.0-incubator-M3-bin\samples\RubyC
> al culator\deploy\sample.calculator/.dll, error: The specified module 
> could not be found.
>
>         Origin:
>           File:
> ..\..\..\runtime\core\src\tuscany\sca\util\Library.cpp
>           Line:            144
>           Function:        tuscany::sca::util::Library::load
>         Path:
>           File:
> ..\..\..\runtime\extensions\cpp\src\tuscany\sca\cpp\CompositeContextIm
> pl
> .cpp
>           Line:          101
>           Function:
> tuscany::sca::cpp::CompositeContextImpl::locateService
>
>
> Travis
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>


--
Pete

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


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


RE: invoking a non-c++ service from c++

Posted by Travis Vitek <tv...@quovadx.com>.
I have no problems invoking a Python component from Python or Ruby
clients.

=.=.=.=.=.=.=.=.=.=.=.=.=.=.=.
. Travis Vitek               =
= Software Developer         .
. Rogue Wave Software        =
= http://www.roguewave.com   .
.=.=.=.=.=.=.=.=.=.=.=.=.=.=.=

>-----Original Message-----
>From: Andrew Borley [mailto:ajborley@gmail.com] 
>Sent: Tuesday, July 03, 2007 1:37 AM
>To: tuscany-user@ws.apache.org
>Subject: Re: invoking a non-c++ service from c++
>
>Hi Travis,
>
>It's been a little while since I looked at this code, but I think it
>should work. The simple questions first:
>
>Is your Python environment set up correctly? For the M3 Tuscany SCA
>Native release we require Python 2.5 because we use the ElementTree
>XML API. You will also need to ensure that the Python runtime
>libraries are on your PATH and the Tuscany Python extension is on the
>PYTHONPATH environment variable.
>
>If you are using the M2 Tuscany SCA C++ release then you will require
>a .componentType file as well as the .composite and .py
>implementation. The one used in the PythonCalculator sample should be
>fine [1]
>
>Can you get the PythonCalculator sample to run successfully? If so,
>I'll need to do more investigation!
>
>Let me know if any of these things help.
>
>Cheers
>Andy
>
>[1] 
>http://svn.apache.org/repos/asf/incubator/tuscany/tags/cpp-1.0-
>incubating-M2-final/sca/samples/PythonCalculator/sample.calcula
tor/DivideImpl.componentType
>On 7/3/07, Travis Vitek <tv...@quovadx.com> wrote:
>>
>> > OK I think  understand. You are using the C++ client from
>> > CppCalulator to try and access the RubyCalulator component?
>>
>> Exactly. Ruby, Python or whatever. You get the idea.
>>
>> > At the moment there is a restriction here in that the C++
>> > client can only locate/call a C++ service. This is because
>> > the locateService returns a C++ proxy to the service. These
>> > are generated by the scagen utility form the information in
>> > the interface headers, composite and componentType files and
>> > built into the implementation dll. For a Ruby component
>> > implementation there is no dll and no generated proxy.
>>
>> Yeah, I build the source distribution and stepped into it. I 
>think I'm
>> seeing the problem.
>>
>> > You can call Ruby components from C++ components as here the
>> > interface on the reference from the C++ component to the Ruby
>> > component is sufficeient to generate the proxy which will be
>> > built in to the c++ component implementation dll.
>>
>> Well, I managed to get CppCalculator to reference the Ruby
>> DivideComponent. That seemed to work without a hitch. 
>Unfortunately it
>> bombs out if I attempt to use the python DivideComponent 
>implementation.
>> Since I'm just getting started with this SCA stuff, I'll 
>outline what I
>> did.
>>
>> I copied the RubyCalculator/sample.calculator/DivideImpl.rb and
>> PythonCalculator/sample.calculator/DivideImpl.py files into
>> CppCalculator/deploy/sample.calculator. I opened up
>> 
>CppCalculator/deploy/sample.calculator/sample.calculator.composite and
>> added component entries for the Ruby and Python implementations,
>> commenting out all but one of the them for testing. So I 
>have something
>> like this.
>>
>>         <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>>                 name="sample.calculator">
>>
>>                 <component name="CalculatorComponent">
>>                         <implementation.cpp library="Calculator"
>> header="CalculatorImpl.h"/>
>>                         <reference
>> name="divideService">DivideComponent/DivideService</reference>
>>                 </component>
>>
>>         <!--
>>                 <component name="DivideComponent">
>>                         <implementation.cpp library="Calculator"
>> header="DivideImpl.h"/>
>>                 </component>
>>         -->
>>
>>         <!--
>>                 <component name="DivideComponent">
>>                         <implementation.ruby script="DivideImpl.rb"
>> class="DivideImpl"/>
>>                 </component>
>>         -->
>>
>>                 <component name="DivideComponent">
>>                         <implementation.python module="DivideImpl"
>> scope="composite"/>
>>                 </component>
>>
>>         </composite>
>>
>> Then I ran the C++ client test program
>> CppCalculator/deploy/sample.calculator.client/runclient.bat. As
>> mentioned above, everything works just fine using the C++ and Ruby
>> implementations, but it crashes out with the Python one. All of this
>> testing is being done with the binary distribution, just to eliminate
>> the chance of any issues being caused by a bad build.
>>
>> If I did something wrong, maybe someone could let me know?
>>
>> Travis
>>
>> > Cheers,
>> >
>> > On 01/07/07, Travis Vitek <tv...@quovadx.com> wrote:
>> > >
>> > > I'm using the Calculator example services. I setup a batch
>> > > file to run each client implementation against each service
>> > > implementation. Before running a client, I set the
>> > > TUSCANY_SCACPP_ROOT environment variable. I can provide that
>> > > batch file if you'd like.
>> > >
>> > > Travis
>> > >
>> > > -----Original Message-----
>> > > From: Pete Robbins
>> > >
>> > > Hi Travis. Could you post your .composite and .comonentType
>> > > files please. There may be a restriction of calling a Ruby
>> > > component directly from a C++ client... I'd need to check.
>> > > Have you tried having the client call initially into a C++
>> > > component which then invokes the Ruby component?
>> > >
>> > > Cheers,
>> > >
>> > > On 30/06/07, Travis Vitek <tv...@quovadx.com> wrote:
>> > > >
>> > > > I've been playing with Tuscany SCA for a few days and
>> > > > I've run into something that I believe should work but
>> > > > does not. As the subject indicates, I'm trying to invoke
>> > > > a local non-c++ service from a c++ client via Tuscany
>> > > > SCA Native....
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
>For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>

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


Re: invoking a non-c++ service from c++

Posted by Andrew Borley <aj...@gmail.com>.
Hi Travis,

It's been a little while since I looked at this code, but I think it
should work. The simple questions first:

Is your Python environment set up correctly? For the M3 Tuscany SCA
Native release we require Python 2.5 because we use the ElementTree
XML API. You will also need to ensure that the Python runtime
libraries are on your PATH and the Tuscany Python extension is on the
PYTHONPATH environment variable.

If you are using the M2 Tuscany SCA C++ release then you will require
a .componentType file as well as the .composite and .py
implementation. The one used in the PythonCalculator sample should be
fine [1]

Can you get the PythonCalculator sample to run successfully? If so,
I'll need to do more investigation!

Let me know if any of these things help.

Cheers
Andy

[1] http://svn.apache.org/repos/asf/incubator/tuscany/tags/cpp-1.0-incubating-M2-final/sca/samples/PythonCalculator/sample.calculator/DivideImpl.componentType
On 7/3/07, Travis Vitek <tv...@quovadx.com> wrote:
>
> > OK I think  understand. You are using the C++ client from
> > CppCalulator to try and access the RubyCalulator component?
>
> Exactly. Ruby, Python or whatever. You get the idea.
>
> > At the moment there is a restriction here in that the C++
> > client can only locate/call a C++ service. This is because
> > the locateService returns a C++ proxy to the service. These
> > are generated by the scagen utility form the information in
> > the interface headers, composite and componentType files and
> > built into the implementation dll. For a Ruby component
> > implementation there is no dll and no generated proxy.
>
> Yeah, I build the source distribution and stepped into it. I think I'm
> seeing the problem.
>
> > You can call Ruby components from C++ components as here the
> > interface on the reference from the C++ component to the Ruby
> > component is sufficeient to generate the proxy which will be
> > built in to the c++ component implementation dll.
>
> Well, I managed to get CppCalculator to reference the Ruby
> DivideComponent. That seemed to work without a hitch. Unfortunately it
> bombs out if I attempt to use the python DivideComponent implementation.
> Since I'm just getting started with this SCA stuff, I'll outline what I
> did.
>
> I copied the RubyCalculator/sample.calculator/DivideImpl.rb and
> PythonCalculator/sample.calculator/DivideImpl.py files into
> CppCalculator/deploy/sample.calculator. I opened up
> CppCalculator/deploy/sample.calculator/sample.calculator.composite and
> added component entries for the Ruby and Python implementations,
> commenting out all but one of the them for testing. So I have something
> like this.
>
>         <composite xmlns="http://www.osoa.org/xmlns/sca/1.0"
>                 name="sample.calculator">
>
>                 <component name="CalculatorComponent">
>                         <implementation.cpp library="Calculator"
> header="CalculatorImpl.h"/>
>                         <reference
> name="divideService">DivideComponent/DivideService</reference>
>                 </component>
>
>         <!--
>                 <component name="DivideComponent">
>                         <implementation.cpp library="Calculator"
> header="DivideImpl.h"/>
>                 </component>
>         -->
>
>         <!--
>                 <component name="DivideComponent">
>                         <implementation.ruby script="DivideImpl.rb"
> class="DivideImpl"/>
>                 </component>
>         -->
>
>                 <component name="DivideComponent">
>                         <implementation.python module="DivideImpl"
> scope="composite"/>
>                 </component>
>
>         </composite>
>
> Then I ran the C++ client test program
> CppCalculator/deploy/sample.calculator.client/runclient.bat. As
> mentioned above, everything works just fine using the C++ and Ruby
> implementations, but it crashes out with the Python one. All of this
> testing is being done with the binary distribution, just to eliminate
> the chance of any issues being caused by a bad build.
>
> If I did something wrong, maybe someone could let me know?
>
> Travis
>
> > Cheers,
> >
> > On 01/07/07, Travis Vitek <tv...@quovadx.com> wrote:
> > >
> > > I'm using the Calculator example services. I setup a batch
> > > file to run each client implementation against each service
> > > implementation. Before running a client, I set the
> > > TUSCANY_SCACPP_ROOT environment variable. I can provide that
> > > batch file if you'd like.
> > >
> > > Travis
> > >
> > > -----Original Message-----
> > > From: Pete Robbins
> > >
> > > Hi Travis. Could you post your .composite and .comonentType
> > > files please. There may be a restriction of calling a Ruby
> > > component directly from a C++ client... I'd need to check.
> > > Have you tried having the client call initially into a C++
> > > component which then invokes the Ruby component?
> > >
> > > Cheers,
> > >
> > > On 30/06/07, Travis Vitek <tv...@quovadx.com> wrote:
> > > >
> > > > I've been playing with Tuscany SCA for a few days and
> > > > I've run into something that I believe should work but
> > > > does not. As the subject indicates, I'm trying to invoke
> > > > a local non-c++ service from a c++ client via Tuscany
> > > > SCA Native....
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>

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


RE: invoking a non-c++ service from c++

Posted by Travis Vitek <tv...@quovadx.com>.
> OK I think  understand. You are using the C++ client from 
> CppCalulator to try and access the RubyCalulator component?

Exactly. Ruby, Python or whatever. You get the idea.

> At the moment there is a restriction here in that the C++ 
> client can only locate/call a C++ service. This is because 
> the locateService returns a C++ proxy to the service. These 
> are generated by the scagen utility form the information in 
> the interface headers, composite and componentType files and 
> built into the implementation dll. For a Ruby component 
> implementation there is no dll and no generated proxy.

Yeah, I build the source distribution and stepped into it. I think I'm
seeing the problem.

> You can call Ruby components from C++ components as here the 
> interface on the reference from the C++ component to the Ruby 
> component is sufficeient to generate the proxy which will be 
> built in to the c++ component implementation dll.

Well, I managed to get CppCalculator to reference the Ruby
DivideComponent. That seemed to work without a hitch. Unfortunately it
bombs out if I attempt to use the python DivideComponent implementation.
Since I'm just getting started with this SCA stuff, I'll outline what I
did.

I copied the RubyCalculator/sample.calculator/DivideImpl.rb and
PythonCalculator/sample.calculator/DivideImpl.py files into
CppCalculator/deploy/sample.calculator. I opened up
CppCalculator/deploy/sample.calculator/sample.calculator.composite and
added component entries for the Ruby and Python implementations,
commenting out all but one of the them for testing. So I have something
like this.

	<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" 
		name="sample.calculator">

		<component name="CalculatorComponent">
			<implementation.cpp library="Calculator"
header="CalculatorImpl.h"/>
			<reference
name="divideService">DivideComponent/DivideService</reference>
		</component>

	<!--
		<component name="DivideComponent">
			<implementation.cpp library="Calculator"
header="DivideImpl.h"/>
		</component>
	-->

	<!--
		<component name="DivideComponent">
			<implementation.ruby script="DivideImpl.rb"
class="DivideImpl"/>
		</component>
	-->

		<component name="DivideComponent">
			<implementation.python module="DivideImpl"
scope="composite"/>
		</component>

	</composite>

Then I ran the C++ client test program
CppCalculator/deploy/sample.calculator.client/runclient.bat. As
mentioned above, everything works just fine using the C++ and Ruby
implementations, but it crashes out with the Python one. All of this
testing is being done with the binary distribution, just to eliminate
the chance of any issues being caused by a bad build.

If I did something wrong, maybe someone could let me know?

Travis

> Cheers,
> 
> On 01/07/07, Travis Vitek <tv...@quovadx.com> wrote:
> >
> > I'm using the Calculator example services. I setup a batch 
> > file to run each client implementation against each service 
> > implementation. Before running a client, I set the
> > TUSCANY_SCACPP_ROOT environment variable. I can provide that
> > batch file if you'd like.
> >
> > Travis
> >
> > -----Original Message-----
> > From: Pete Robbins
> >
> > Hi Travis. Could you post your .composite and .comonentType
> > files please. There may be a restriction of calling a Ruby
> > component directly from a C++ client... I'd need to check.
> > Have you tried having the client call initially into a C++
> > component which then invokes the Ruby component?
> >
> > Cheers,
> >
> > On 30/06/07, Travis Vitek <tv...@quovadx.com> wrote:
> > >
> > > I've been playing with Tuscany SCA for a few days and 
> > > I've run into something that I believe should work but
> > > does not. As the subject indicates, I'm trying to invoke
> > > a local non-c++ service from a c++ client via Tuscany
> > > SCA Native....

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


Re: invoking a non-c++ service from c++

Posted by Pete Robbins <ro...@googlemail.com>.
OK I think  understand. You are using the C++ client from CppCalulator
to try and access the RubyCalulator component?

At the moment there is a restriction here in that the C++ client can
only locate/call a C++ service. This is because the locateService
returns a C++ proxy to the service. These are generated by the scagen
utility form the information in the interface headers, composite and
componentType files and built into the implementation dll. For a Ruby
component implementation there is no dll and no generated proxy.

You can call Ruby components from C++ components as here the interface
on the reference from the C++ component to the Ruby component is
sufficeient to generate the proxy which will be built in to the c++
component implementation dll.

Cheers,

On 01/07/07, Travis Vitek <tv...@quovadx.com> wrote:
>
> I'm using the Calculator example services. I setup a batch file to run
> each client implementation against each service implementation. Before
> running a client, I set the TUSCANY_SCACPP_ROOT environment variable. I
> can provide that batch file if you'd like.
>
> Travis
>
> -----Original Message-----
> From: Pete Robbins
>
> Hi Travis. Could you post your .composite and .comonentType files
> please. There may be a restriction of calling a Ruby component directly
> from a C++ client... I'd need to check. Have you tried having the client
> call initially into a C++ component which then invokes the Ruby
> component?
>
> Cheers,
>
> On 30/06/07, Travis Vitek <tv...@quovadx.com> wrote:
> >
> > I've been playing with Tuscany SCA for a few days and I've run into
> > something that I believe should work but does not. As the subject
> > indicates, I'm trying to invoke a local non-c++ service from a c++
> > client via Tuscany SCA Native. I've scoured the documentation and
> > haven't seen anything indicating that this is a known limitation,
> > perhaps I'm doing something wrong?
> >
> > Here is the output I get when running the C++ client against a ruby
> > service.
> >
> >        calculator_client: exception caught: Exception
> >         Class:           SystemConfigurationException
> >         Description:     Unable to load library:
> > C:\build\tuscany\tuscany_sca_native-1.0-incubator-M3-bin\samples\RubyC
> > al culator\deploy\sample.calculator/.dll, error: The specified module
> > could not be found.
> >
> >         Origin:
> >           File:
> > ..\..\..\runtime\core\src\tuscany\sca\util\Library.cpp
> >           Line:            144
> >           Function:        tuscany::sca::util::Library::load
> >         Path:
> >           File:
> > ..\..\..\runtime\extensions\cpp\src\tuscany\sca\cpp\CompositeContextIm
> > pl
> > .cpp
> >           Line:          101
> >           Function:
> > tuscany::sca::cpp::CompositeContextImpl::locateService
> >
> >
> > Travis
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: tuscany-user-help@ws.apache.org
> >
> >
>
>
> --
> Pete
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tuscany-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: tuscany-user-help@ws.apache.org
>
>


-- 
Pete

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