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

Duncan Grisby dgrisby@uk.research.att.com
Fri, 23 Mar 2001 12:16:49 +0000


------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <2808.985349756.1@pineapple>

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.


------- =_aaaaaaaaaa0
Content-Type: text/plain; name="expt.idl"; charset="us-ascii"
Content-ID: <2808.985349756.2@pineapple>

struct HyperLinkData 
{ 
  string name; 
  string href; 
}; 

typedef sequence<HyperLinkData> HyperLinks; 

interface itf 
{ 
  void storeHyperLinks(in HyperLinks linkdata, in long entry_id); 
};

------- =_aaaaaaaaaa0
Content-Type: text/plain; name="serv.py"; charset="us-ascii"
Content-ID: <2808.985349756.3@pineapple>

#!/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()

------- =_aaaaaaaaaa0
Content-Type: text/plain; name="clt.py"; charset="us-ascii"
Content-ID: <2808.985349756.4@pineapple>

#!/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)

------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-ID: <2808.985349756.5@pineapple>

-- 
 -- Duncan Grisby  \  Research Engineer  --
  -- AT&T Laboratories Cambridge          --
   -- http://www.uk.research.att.com/~dpg1 --

------- =_aaaaaaaaaa0--