Discussion:
[omniORB] Sequence in Any marshalling failure
Franzen, Holger
2007-05-26 20:54:58 UTC
Permalink
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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: zoaXMLData.idl
Type: text/x-csrc
Size: 1957 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070526/68c55560/zoaXMLData.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmldataseqanytestcasecallee.log
Type: text/x-log
Size: 9044 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070526/68c55560/xmldataseqanytestcasecallee.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xmldataseqanytestcaseimpl.log
Type: text/x-log
Size: 6005 bytes
Desc: not available
Url : http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20070526/68c55560/xmldataseqanytestcaseimpl.bin
Duncan Grisby
2007-05-26 22:56:26 UTC
Permalink
Post by Franzen, Holger
I encountered an marshalling failure for sequences of my XMLData type
passed in an CORBA::Any container.
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.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Franzen, Holger
2007-06-09 23:50:20 UTC
Permalink
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> --
Post by Duncan Grisby
Post by Franzen, Holger
I encountered an marshalling failure for sequences of my XMLData type
passed in an CORBA::Any container.
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.
Hi everybody,
I encountered an marshalling failure for sequences of my XMLData type
passed in an CORBA::Any container.
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.
[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
Duncan Grisby
2007-06-13 15:26:27 UTC
Permalink
On Saturday 26 May, "Franzen, Holger" wrote:

[...]
Running XMLDataSeqAnyTestCase...
omniORB: Invoke '_is_a' on remote: key<NameService>
omniORB: Invoke 'resolve' on remote: key<NameService>
omniORB: Invoke 'callWithAny' on remote: root<1952805748>
omniORB: Invoke 'callWithAny' on remote: root<1952805748>
omniORB: throw MARSHAL from GIOP_C.cc:276 (NO,MARSHAL_PassEndOfMessage)
TestCase::callWithAny failed for XMLDataSeq
Hopefully you get my code running...
Thanks for the code. I successfully reproduced the problem. It is indeed
a bug, in the way TypeCodes for recursive structures are unmarshalled. I
have fixed it in CVS.

Cheers,

Duncan.
--
-- Duncan Grisby --
-- ***@grisby.org --
-- http://www.grisby.org --
Continue reading on narkive:
Loading...