[omniORB] omniorb_py and trading service

Bernd Winterstein bernd.winterstein at vodafone.com
Thu Jun 26 16:04:14 BST 2003


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



More information about the omniORB-list mailing list