[omniORB] omniorb_py and trading service

Lars von Wedel vonwedel at aixcape.org
Thu Jun 26 16:14:09 BST 2003


I never used a trading service, but according to the conventions the OMA/OMG
usually follows in IDL definitions, a PolicySeq should be a sequence. Thus,
the corresponding Python argument for an empty sequence would be a []
instead of a string (which is, strictly speaking, a sequence, too for
Python...).

Lars

 > -----Original Message-----
 > From: omniorb-list-bounces at omniorb-support.com [mailto:omniorb-list-
 > bounces at omniorb-support.com] On Behalf Of Bernd Winterstein
 > Sent: Thursday, June 26, 2003 3:04 PM
 > To: omniorb-list
 > Subject: Re: [omniORB] omniorb_py and trading service
 > 
 > Okay Thanks Duncan.
 > I'm pretty new to python. I'm trying to write a test driver for an C++
 > appliction in python. Maybe anyone can help me with this problem
 > accessing the TradingService. I don't get the right parametrs to call
 > the query function.
 > 
 > Here is the idl:
 > 
 >                 void query (
 >                         in ServiceTypeName type,
 >                         in Constraint constr,
 >                         in Preference pref,
 >                         in PolicySeq policies,
 >                         in SpecifiedProps desired_props,
 >                         in unsigned long how_many,
 >                         out OfferSeq offers,
 >                         out OfferIterator offer_itr,
 >                         out PolicyNameSeq limits_applied
 >                 ) raises (...)
 > 
 > Here is what I try:
 > 
 > policies = []
 > policies.append( CosTrading.Policy("","") )
 > desiredProps = CosTrading.Lookup.SpecifiedProps(
 > CosTrading.Lookup.HowManyProps, CosTrading.Lookup.all)
 > lookup.query("ExampleService", "TRUE", "", policies, desiredProps, 100 )
 > 
 > 
 > Thats what I get:
 > Traceback (most recent call last):
 >   File "./ExampleClient.py", line 57, in ?
 >     lookup.query("ExampleService", "TRUE", "", policies, desiredProps,
 > 100 )
 >   File
 > "/home/tesp/bwinters/ld/omniorb_py/lib/python2.2/site-
 > packages/omniORB/COS/CosTrading_idl.py",
 > line 906, in query
 >     return _omnipy.invoke(self, "query", _0_CosTrading.Lookup._d_query,
 > args)
 > omniORB.CORBA.BAD_PARAM: Minor: BAD_PARAM_WrongPythonType, COMPLETED_NO.
 > 
 > :-(
 > 
 > Any ideas?
 > 
 > Duncan Grisby wrote:
 > 
 > >On Thursday 26 June, Bernd Winterstein wrote:
 > >
 > >
 > >
 > >>I have a problem accessing the TradingService from python. Maybe anyone
 > >>has a good idea.
 > >>
 > >>
 > >
 > >[...]
 > >
 > >
 > >>lookup.query("ExampleService", "TRUE", "", policies, desiredProps, 1,
 > >>offers, iterator, appliedPolicies )
 > >>
 > >>
 > >[...]
 > >
 > >
 > >>TypeError: Operation requires 6 arguments; 9 given
 > >>
 > >>
 > >
 > >You're calling query() with the wrong number of arguments, just like
 > >it says. IDL out arguments are represented as extra returns values in
 > >a tuple, not as parameters.
 > >
 > >Cheers,
 > >
 > >Duncan.
 > >
 > >
 > >
 > 
 > _______________________________________________
 > omniORB-list mailing list
 > omniORB-list at omniorb-support.com
 > http://www.omniorb-support.com/mailman/listinfo/omniorb-list





More information about the omniORB-list mailing list