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

John D. Heintz jheintz@isogen.com
Fri, 23 Mar 2001 10:22:45 -0600


Sure enough your example works fine.  I'll take a look at our code 
again, but I thought we were getting the right order...

Thanks,
John

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)
> 
> expt.idl
> 
> Content-Type:
> 
> text/plain
> 
> 
> ------------------------------------------------------------------------
> serv.py
> 
> Content-Type:
> 
> text/plain
> 
> 
> ------------------------------------------------------------------------
> clt.py
> 
> Content-Type:
> 
> text/plain
> 
> 
> ------------------------------------------------------------------------
> attachment.txt
> 
> Content-Type:
> 
> text/plain



-- 
. . . . . . . . . . . . . . . . . . . . . . . .

John D. Heintz | Senior Engineer

1016 La Posada Dr. | Suite 240 | Austin TX 78752
T 512.633.1198 | jheintz@isogen.com

w w w . d a t a c h a n n e l . c o m