[omniORB] TypeCodes, tk_alias, OmniORB, and JacORB

Monceaux, Weston P ERDC-ITL-MS Contractor Weston.P.Monceaux@erdc.usace.army.mil
Mon, 4 Dec 2000 07:12:17 -0600


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C05DF3.D7F1335E
Content-Type: text/plain;
	charset="iso-8859-1"

Apologies for the HTML.

Here is the failing C++ code:

// ....
CORBA::Any* any = data_var->get_prop("value");

const FrameworkServices::TraderEntrySeq* tess = NULL;
if((*any) >>= tess) // <-- Does not extract here
	cout << "extracted TES\n";

if(any->type()->kind() == CORBA::tk_alias)
	cout << "any is of type tk_alias\n";
else if(any->type()->kind() == CORBA::tk_sequence)
	cout << "any is of type tk_sequence\n";
else
	cout << "any is not tk_alias or tk_sequence\n";

typecodeParse::parseCode(any->type());

if(any)
	delete any;
// ....

As far as I can tell, the Java ORB I am using (JacORB) claims it is
returning a tk_alias type.  Watching everything through the debugger with
OmniORB on the above code shows it as a tk_sequence.  The typecodeParse code
in the mailing-list shows the Any as containing tk_sequence as well.  Here
is its output:

any is of type tk_sequence
  tk_sequence
  Maximum length: 0
Unbounded Sequence.
  Content Type:
  tk_struct
  Repository Id: IDL:FrameworkServices/TraderEntrySeq:1.0
  Struct Name: TraderEntry
  Number of members: 12
   Member index: 0.
   Member name: object_ref

   Member typecode: 
  tk_string
  Maximum length: 0

   Member index: 1.
   Member name: name

   Member typecode: 
  tk_string
  Maximum length: 0

   Member index: 2.
   Member name: summary

   Member typecode: 
  tk_string
  Maximum length: 0

   Member index: 3.
   Member name: help_url

   Member typecode: 
  tk_string
  Maximum length: 0

   Member index: 4.
   Member name: ui_url

   Member typecode: 
  tk_string
  Maximum length: 0

   Member index: 5.
   Member name: host

   Member typecode: 
  tk_string
  Maximum length: 0

   Member index: 6.
   Member name: email_contact

   Member typecode: 
  tk_string
  Maximum length: 0

   Member index: 7.
   Member name: language

   Member typecode: 
  tk_string
  Maximum length: 0

   Member index: 8.
   Member name: type

   Member typecode: 
  tk_string
  Maximum length: 0

   Member index: 9.
   Member name: quality

   Member typecode: 
tk_double

   Member index: 10.
   Member name: input_type

   Member typecode: 
  tk_string
  Maximum length: 0

   Member index: 11.
   Member name: output_type

   Member typecode: 
  tk_string
  Maximum length: 0

This sequence was supposed to contain 2 elements upon being sent
back....although I am not sure if that would have shown up within the
typecodeParse output.  Also, attempting to force the TypeCode of the any to
the desired one does not work as it seems to fail the TypeCode::equivalent()
operation, as in:

any->type(FrameworkServices::_tc_TraderEntrySeq);

Any ideas?  or am I still short on information?

Thanks again for your help.

Weston



> -----Original Message-----
> From: Duncan Grisby [mailto:dgrisby@uk.research.att.com]
> Sent: Monday, December 04, 2000 06:12
> To: Monceaux, Weston P ERDC-ITL-MS Contractor
> Cc: 'omniorb-list@uk.research.att.com'
> Subject: Re: [omniORB] TypeCodes, tk_alias, OmniORB, and JacORB 
> 
> 
> On Monday 4 December, "Monceaux, Weston P ERDC-ITL-MS 
> Contractor" wrote:
> 
> Please don't send HTML email to this list. It just gets in the way.
> 
> [...]
> > I am inserting a TraderEntrySeq into and Any in my Java 
> code using JacORB,
> > and trying to extract it from a C++ client using OmniORB.  
> The best I can
> > determine is that it is a mis-matching of TypeCodes.  
> JacORB reports the
> > type as tk_alias while the C++ client reports it is 
> receiving a tk_sequence
> > instead of the tk_alias it is expecting.  Anyone else 
> running across similar
> > problems?  Any suggestions?
> 
> What exactly is the error you are getting?  What is the C++ code which
> is failing?  omniORB should happily extract your sequence from an Any,
> regardless as to whether it has alias TypeCodes in it or not.
> 
> Cheers,
> 
> Duncan.
> 
> -- 
>  -- Duncan Grisby  \  Research Engineer  --
>   -- AT&T Laboratories Cambridge          --
>    -- http://www.uk.research.att.com/~dpg1 --
> 

------_=_NextPart_001_01C05DF3.D7F1335E
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
5.5.2448.0">
<TITLE>RE: [omniORB] TypeCodes, tk_alias, OmniORB, and JacORB </TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=3D2>Apologies for the HTML.</FONT>
</P>

<P><FONT SIZE=3D2>Here is the failing C++ code:</FONT>
</P>

<P><FONT SIZE=3D2>// ....</FONT>
<BR><FONT SIZE=3D2>CORBA::Any* any =3D =
data_var-&gt;get_prop(&quot;value&quot;);</FONT>
</P>

<P><FONT SIZE=3D2>const FrameworkServices::TraderEntrySeq* tess =3D =
NULL;</FONT>
<BR><FONT SIZE=3D2>if((*any) &gt;&gt;=3D tess) // &lt;-- Does not =
extract here</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>cout =
&lt;&lt; &quot;extracted TES\n&quot;;</FONT>
</P>

<P><FONT SIZE=3D2>if(any-&gt;type()-&gt;kind() =3D=3D =
CORBA::tk_alias)</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>cout =
&lt;&lt; &quot;any is of type tk_alias\n&quot;;</FONT>
<BR><FONT SIZE=3D2>else if(any-&gt;type()-&gt;kind() =3D=3D =
CORBA::tk_sequence)</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>cout =
&lt;&lt; &quot;any is of type tk_sequence\n&quot;;</FONT>
<BR><FONT SIZE=3D2>else</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>cout =
&lt;&lt; &quot;any is not tk_alias or tk_sequence\n&quot;;</FONT>
</P>

<P><FONT SIZE=3D2>typecodeParse::parseCode(any-&gt;type());</FONT>
</P>

<P><FONT SIZE=3D2>if(any)</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=3D2>delete =
any;</FONT>
<BR><FONT SIZE=3D2>// ....</FONT>
</P>

<P><FONT SIZE=3D2>As far as I can tell, the Java ORB I am using =
(JacORB) claims it is returning a tk_alias type.&nbsp; Watching =
everything through the debugger with OmniORB on the above code shows it =
as a tk_sequence.&nbsp; The typecodeParse code in the mailing-list =
shows the Any as containing tk_sequence as well.&nbsp; Here is its =
output:</FONT></P>

<P><FONT SIZE=3D2>any is of type tk_sequence</FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_sequence</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
<BR><FONT SIZE=3D2>Unbounded Sequence.</FONT>
<BR><FONT SIZE=3D2>&nbsp; Content Type:</FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_struct</FONT>
<BR><FONT SIZE=3D2>&nbsp; Repository Id: =
IDL:FrameworkServices/TraderEntrySeq:1.0</FONT>
<BR><FONT SIZE=3D2>&nbsp; Struct Name: TraderEntry</FONT>
<BR><FONT SIZE=3D2>&nbsp; Number of members: 12</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 0.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: object_ref</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_string</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 1.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: name</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_string</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 2.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: summary</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_string</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 3.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: help_url</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_string</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 4.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: ui_url</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_string</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 5.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: host</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_string</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 6.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: email_contact</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_string</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 7.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: language</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_string</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 8.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: type</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_string</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 9.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: quality</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>tk_double</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 10.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: input_type</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_string</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member index: 11.</FONT>
<BR><FONT SIZE=3D2>&nbsp;&nbsp; Member name: output_type</FONT>
</P>

<P><FONT SIZE=3D2>&nbsp;&nbsp; Member typecode: </FONT>
<BR><FONT SIZE=3D2>&nbsp; tk_string</FONT>
<BR><FONT SIZE=3D2>&nbsp; Maximum length: 0</FONT>
</P>

<P><FONT SIZE=3D2>This sequence was supposed to contain 2 elements upon =
being sent back....although I am not sure if that would have shown up =
within the typecodeParse output.&nbsp; Also, attempting to force the =
TypeCode of the any to the desired one does not work as it seems to =
fail the TypeCode::equivalent() operation, as in:</FONT></P>

<P><FONT =
SIZE=3D2>any-&gt;type(FrameworkServices::_tc_TraderEntrySeq);</FONT>
</P>

<P><FONT SIZE=3D2>Any ideas?&nbsp; or am I still short on =
information?</FONT>
</P>

<P><FONT SIZE=3D2>Thanks again for your help.</FONT>
</P>

<P><FONT SIZE=3D2>Weston</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=3D2>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=3D2>&gt; From: Duncan Grisby [<A =
HREF=3D"mailto:dgrisby@uk.research.att.com">mailto:dgrisby@uk.research.a=
tt.com</A>]</FONT>
<BR><FONT SIZE=3D2>&gt; Sent: Monday, December 04, 2000 06:12</FONT>
<BR><FONT SIZE=3D2>&gt; To: Monceaux, Weston P ERDC-ITL-MS =
Contractor</FONT>
<BR><FONT SIZE=3D2>&gt; Cc: 'omniorb-list@uk.research.att.com'</FONT>
<BR><FONT SIZE=3D2>&gt; Subject: Re: [omniORB] TypeCodes, tk_alias, =
OmniORB, and JacORB </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; On Monday 4 December, &quot;Monceaux, Weston P =
ERDC-ITL-MS </FONT>
<BR><FONT SIZE=3D2>&gt; Contractor&quot; wrote:</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Please don't send HTML email to this list. It =
just gets in the way.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; [...]</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; I am inserting a TraderEntrySeq into and =
Any in my Java </FONT>
<BR><FONT SIZE=3D2>&gt; code using JacORB,</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; and trying to extract it from a C++ client =
using OmniORB.&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; The best I can</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; determine is that it is a mis-matching of =
TypeCodes.&nbsp; </FONT>
<BR><FONT SIZE=3D2>&gt; JacORB reports the</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; type as tk_alias while the C++ client =
reports it is </FONT>
<BR><FONT SIZE=3D2>&gt; receiving a tk_sequence</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; instead of the tk_alias it is =
expecting.&nbsp; Anyone else </FONT>
<BR><FONT SIZE=3D2>&gt; running across similar</FONT>
<BR><FONT SIZE=3D2>&gt; &gt; problems?&nbsp; Any suggestions?</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; What exactly is the error you are =
getting?&nbsp; What is the C++ code which</FONT>
<BR><FONT SIZE=3D2>&gt; is failing?&nbsp; omniORB should happily =
extract your sequence from an Any,</FONT>
<BR><FONT SIZE=3D2>&gt; regardless as to whether it has alias TypeCodes =
in it or not.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Cheers,</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; Duncan.</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
<BR><FONT SIZE=3D2>&gt; -- </FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp; -- Duncan Grisby&nbsp; \&nbsp; Research =
Engineer&nbsp; --</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp; -- AT&amp;T Laboratories =
Cambridge&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
--</FONT>
<BR><FONT SIZE=3D2>&gt;&nbsp;&nbsp;&nbsp; -- <A =
HREF=3D"http://www.uk.research.att.com/~dpg1" =
TARGET=3D"_blank">http://www.uk.research.att.com/~dpg1</A> --</FONT>
<BR><FONT SIZE=3D2>&gt; </FONT>
</P>

</BODY>
</HTML>
------_=_NextPart_001_01C05DF3.D7F1335E--