[omniORB] omniORBpy and sequence of structs again...

Lars von Wedel vonWedel@lfpt.rwth-aachen.de
Fri, 23 Mar 2001 13:43:48 +0100


This is a multi-part message in MIME format.
--------------9C86717942D165D2F6E19FBA
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


I had a similar problem with structs some time ago. I nailed it down
to mixing up the order of members in the constructor argument list.
As Python does not check these, you can create a structure with anything
as contents and will then get a BAD_PARAM exception...

Try whether you can send back a structure you obtained from the
server...

Lars


Duncan Grisby wrote:
> 
> On Thursday 22 March, "John D. Heintz" wrote:
> 
> > We are having the same problem.  Create client side list of structs and
> > get a BAD_PARAM.  I can post the detail if anyone wants them, but it
> > really is the same IDL as the thread above.
> 
> I don't understand the problem. I've implemented a little example
> based on the post from August and it works fine with omniORBpy 1.3 /
> omniORB 3.0.3. I don't think anything has changed since 1.0/3.0.0
> which would affect this.
> 
> I've attached 3 files -- an IDL file, a client, and a server. Run the
> server, then run the client giving the server's IOR on the command
> line.
> 
> Cheers,
> 
> Duncan.
> 
>   ------------------------------------------------------------------------
> struct HyperLinkData
> {
>   string name;
>   string href;
> };
> 
> typedef sequence<HyperLinkData> HyperLinks;
> 
> interface itf
> {
>   void storeHyperLinks(in HyperLinks linkdata, in long entry_id);
> };
> 
>   ------------------------------------------------------------------------
> #!/usr/bin/env python
> 
> import sys, CORBA, PortableServer, _GlobalIDL, _GlobalIDL__POA
> 
> class itf_i (_GlobalIDL__POA.itf):
> 
>     def storeHyperLinks(self, linkdata, entry_id):
>         print map(lambda x: (x.name, x.href), linkdata), entry_id
> 
> orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
> poa = orb.resolve_initial_references("RootPOA")
> ii  = itf_i()
> io  = ii._this()
> 
> print orb.object_to_string(io)
> 
> poaManager = poa._get_the_POAManager()
> poaManager.activate()
> orb.run()
> 
>   ------------------------------------------------------------------------
> #!/usr/bin/env python
> 
> import sys, CORBA, _GlobalIDL
> 
> orb = CORBA.ORB_init(sys.argv, CORBA.ORB_ID)
> o   = orb.string_to_object(sys.argv[1])
> 
> linkdata = [("foo", "bar"), ("wib", "wob")]
> 
> data = []
> for hyperlink in linkdata:
>     entry = _GlobalIDL.HyperLinkData(hyperlink[0], hyperlink[1])
>     data.append(entry)
> 
> o.storeHyperLinks(data, 1234)
> 
>   ------------------------------------------------------------------------
> --
>  -- Duncan Grisby  \  Research Engineer  --
>   -- AT&T Laboratories Cambridge          --
>    -- http://www.uk.research.att.com/~dpg1 --
--------------9C86717942D165D2F6E19FBA
Content-Type: text/x-vcard; charset=us-ascii;
 name="vonWedel.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Lars von Wedel
Content-Disposition: attachment;
 filename="vonWedel.vcf"

begin:vcard 
n:von Wedel;Lars
tel;cell:++49 172 2043412
tel;fax:++49 241 8888326
tel;work:++49 241 805240
x-mozilla-html:TRUE
url:http://www.lfpt.rwth-aachen.de/Staff/vonwedel.html
org:RWTH Aachen;Lehrstuhl fuer Prozesstechnik
adr:;;Turmstrasse 46;52056 Aachen;;;
version:2.1
email;internet:vonWedel@lfpt.rwth-aachen.de
end:vcard

--------------9C86717942D165D2F6E19FBA--