Pensieri di un lunatico minore

10 March 2005 Distributed Objects

Ice and Slice

Slice is the interface definition language (IDL) for Ice and I’ve been having a very bizarre problem with how I was using it—something that worked fine in CORBA. I have a few struct definitions in my file:

module Foo {
  struct MyStruct {
    ...
  };
};

I keep all my “types” (or structures) in the same file, all defined at this top level module level. I then import them into each place that needs them like this:

#include <struct .ice>
module Foo {
  interface Bar {
    MyStruct getStruct();
  };
};</struct>

You would think this works, and at least from my reading of the manual, it should, as it is possible to open and close a module and add new things into it. Unfortunately, this continually gave me an error:

sys:1: RuntimeWarning: invalid return value for operation 'getStruct'
TestApplication.py: warning: dispatch exception: 
    Operation.cpp:870: Ice::MarshalException:
protocol error: error during marshaling or unmarshaling

Somewhat useful, I guess, but unfortuantely it didn’t seem to help me figure it out. When I finally moved the struct definition inside the other file, everything worked. Perhaps it was my running of the slice compiler, slice2py:

$ slice2py -I. --all --output-dir ../lib/ Foo.ice

I’ll post this on the support board and see what other’s think.

Updated: Not 1 hour after posting this to the forums, I got a response from one of the ZeroC staffers that pointed out that my use of --all was not appropriate. Removing it and changing the invocation to:

$ slice2py -I. --output-dir ../lib *.ice

fixed everything up just great! That’s some great responsiveness, and I hope it’s indicative of the level of service they provide their paying customers as well.

This entry was posted at 9:32 pm on 10 March 2005 and is filed under Distributed Objects. You can follow any responses to this entry through the post-specific RSS 2.0 feed.

[...] No, this isn’t some horrid nightmare of an ice-skating competition involving coked-up super-models, it’s some spiffy new technology. Today, I got in my email, an announcement that ZeroC has released a beta version of their Internet Communication Engine with bindings for Ruby. I have written about Ice before, and I’ve used it to build some prototype applications using Python and some C++ (ick). [...]

Responses are currently closed, but you can trackback from your own site.