[omniORB] Sequence in Any marshalling failure

Franzen, Holger holger at k681.cc
Sat Jun 9 20:50:26 BST 2007


Actually i got my code runnig by changing the idl definition:

[From]
...
	enum XMLDataNodeType { ... };

	struct XMLDataAttr { ... };
	typedef sequence<XMLDataAttr> XMLDataAttrSeq;

	// forward declaration
	struct XMLData;
	typedef sequence<XMLData> XMLDataSeq;

	struct XMLData {
		XMLDataNodeType type;
		string name;
		string value;
		XMLDataAttrSeq 	attributes;
		XMLDataSeq children;
	};
...

[To]
...
	enum XMLDataNodeType { ... };

	struct XMLDataAttr { ... };
	typedef sequence<XMLDataAttr> XMLDataAttrSeq;

	struct XMLData {
		XMLDataNodeType type;
		string name;
		string value;
		XMLDataAttrSeq 	attributes;
		sequence<XMLData> children;
	};
	typedef sequence<XMLData> XMLDataSeq;

So avoiding the forward-declaration for the recursive field 'children'
makes the code work. why i don't know maybe an internal typecode
mismatch?

thank's,
 holger.

-- holger franzen <holger(at)k681.cc> --

On Sat, 2007-05-26 at 17:56 +0100, Duncan Grisby wrote:
> On Saturday 26 May, "Franzen, Holger" wrote:
> 
> > I encountered an marshalling failure for sequences of my XMLData type
> > passed in an CORBA::Any container. 
> > 
> > The method call failes with exception minor code:
> > MARSHAL_PassEndOfMessage
> > 
> > omniORB: throw MARSHAL from GIOP_C.cc:276 (NO,MARSHAL_PassEndOfMessage)
> 
> Can you send a complete program that exhibits the problem?
> 
> Cheers,
> 
> Duncan.
> 

On Sat, 26 May 2007 16:55:08 +0200, Holger Franzen wrote
> Hi everybody,
> 
> I encountered an marshalling failure for sequences of my XMLData type
> passed in an CORBA::Any container. 
> 
> The method call failes with exception minor code:
> MARSHAL_PassEndOfMessage
> 
> omniORB: throw MARSHAL from GIOP_C.cc:276
> (NO,MARSHAL_PassEndOfMessage)
> 
> Both client and servant use the same idl. I appended the XMLData.idl
> and
> the traces and logs of client and servant. I'm using omniORB-4.1.0.
> 
> Here is an snippet of the testcase i implemented:
> 
> [XMLDataSeqAnyTestCase.idl]
> ...
> module zoa {
>  interface XMLDataSeqAnyTestCase {
>   void callWithAny(in Any data)
>    raises(Exception);  
>  };
> };
> ...
> 
> [XMLDataSeqAnyTestCaseImpl.cc]
> ...
> void zoa::XMLDataSeqAnyTestCaseImpl::callWithAny(const CORBA::Any
> &data)
>  throw(Exception, CORBA::SystemException)
> {
>  // nothing: won't get called for Any with XMLDataSeq
> }
> ...
> 
> [XMLDataSeqAnyTestCaseCallee.cc]
> ...
>  // our dummy xmldata element
>  // no attributes no children but does not matter either
>  XMLData dummy;
>  dummy.type = XMLDATA_ELEMENT_NODE;
>  dummy.name = CORBA::string_dup("myname");
>  dummy.value = CORBA::string_dup("myvalue");
> 
>  // create xmldatasequence and fill with dummy
>  // element
>  XMLDataSeq_var dataSeq = new XMLDataSeq();
>  dataSeq->length(4);
>  dataSeq.inout()[0] = dummy;
>  dataSeq.inout()[1] = dummy;
>  dataSeq.inout()[2] = dummy;
>  dataSeq.inout()[3] = dummy;
> 
>  // set into any
>  CORBA::Any any;
>  any <<= dataSeq.in();
> 
>  // EnvironmentAnyTestCase_var testCase
>  // alwayse failes with MARSHAL_PassEndOfMessage
>  testCase->callWithAny(any);
> ...
>  //just an XMLData element test
>  CORBA::Any any2;
>  any2 <<= dummy;
> 
>  // runs and data can be retrieved at the servant
>  testCase->callWithAny(any2);
> ...
> 
> 
> I'm a little bit lost - any suggestions?
> 
> Many thanks in advance,
>  Holger.
> 
> ------------------
> Holger Franzen
> holger at k681.cc
> k681.cc




More information about the omniORB-list mailing list