[omniORB] Passing char array from omniORB to javaidl Please help!!

Christian Dyczek christian.dyczek@gmx.at
Fri, 14 Dec 2001 14:50:07 +0100


This is a multi-part message in MIME format.

------=_NextPart_000_0001_01C184AE.A98D7300
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit

Hi
 
For my project i need to transfer a char array from the client (java
idl) to the server (omniORB). This message should have 121 elements.
Therefore I created following idl file:
 
#ifndef __ECHO_IDL__
#define __ECHO_IDL__
 
interface Echo {
  typedef sequence<char,121> msg;
  msg testConnection(in msg testConnection);
};
 
#endif
 
The problem is hat i do not know how I can write into these
sequenz(array)
I think that this line from the xxxSK.cpp is important form e but i am
not able to understand it :
Echo::msg* testConnection(const Echo::msg& testConnection);
 
In the echo example this line looks like that:
char* testConnection(const char* msg);
 
For this line in the example file the c code to save something in this
variable is easy to understand
virtual char* incomingMsg(const char* mesg);
 
I can use msg in all my methods and i am able to return a string: return
CORBA::string_dup("Hier ist die Funktion testConnection");
 
I do not understand this with the created sequence in the idl file. How
can I access testConnection ????
 
 
Thanks Christian

------=_NextPart_000_0001_01C184AE.A98D7300
Content-Type: text/html;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" =
xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns=3D"http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Dus-ascii">


<meta name=3DProgId content=3DWord.Document>
<meta name=3DGenerator content=3D"Microsoft Word 10">
<meta name=3DOriginator content=3D"Microsoft Word 10">
<link rel=3DFile-List href=3D"cid:filelist.xml@01C184AE.9E316DE0">
<!--[if gte mso 9]><xml>
 <o:OfficeDocumentSettings>
  <o:DoNotRelyOnCSS/>
 </o:OfficeDocumentSettings>
</xml><![endif]--><!--[if gte mso 9]><xml>
 <w:WordDocument>
  <w:SpellingState>Clean</w:SpellingState>
  <w:GrammarState>Clean</w:GrammarState>
  <w:DocumentKind>DocumentEmail</w:DocumentKind>
  <w:HyphenationZone>21</w:HyphenationZone>
  <w:EnvelopeVis/>
  <w:Compatibility>
   <w:BreakWrappedTables/>
   <w:SnapToGridInCell/>
   <w:WrapTextWithPunct/>
   <w:UseAsianBreakRules/>
  </w:Compatibility>
  <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
 </w:WordDocument>
</xml><![endif]-->
<style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{mso-style-parent:"";
	margin:0cm;
	margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:12.0pt;
	font-family:"Times New Roman";
	mso-fareast-font-family:"Times New Roman";
	mso-ansi-language:DE-AT;}
a:link, span.MsoHyperlink
	{color:blue;
	text-decoration:underline;
	text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
	{color:purple;
	text-decoration:underline;
	text-underline:single;}
span.EmailFormatvorlage17
	{mso-style-type:personal-compose;
	mso-style-noshow:yes;
	mso-ansi-font-size:10.0pt;
	mso-bidi-font-size:10.0pt;
	font-family:Arial;
	mso-ascii-font-family:Arial;
	mso-hansi-font-family:Arial;
	mso-bidi-font-family:Arial;
	color:windowtext;}
span.SpellE
	{mso-style-name:"";
	mso-spl-e:yes;}
span.GramE
	{mso-style-name:"";
	mso-gram-e:yes;}
@page Section1
	{size:595.3pt 841.9pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;
	mso-header-margin:35.4pt;
	mso-footer-margin:35.4pt;
	mso-paper-source:0;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 10]>
<style>
 /* Style Definitions */=20
 table.MsoNormalTable
	{mso-style-name:"Normale Tabelle";
	mso-tstyle-rowband-size:0;
	mso-tstyle-colband-size:0;
	mso-style-noshow:yes;
	mso-style-parent:"";
	mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
	mso-para-margin:0cm;
	mso-para-margin-bottom:.0001pt;
	mso-pagination:widow-orphan;
	font-size:10.0pt;
	font-family:"Times New Roman";}
</style>
<![endif]-->
</head>

<body lang=3DDE link=3Dblue vlink=3Dpurple =
style=3D'tab-interval:35.4pt'>

<div class=3DSection1>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>Hi<o:p></o:p></span></f=
ont></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span=
></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>For my project <span
class=3DSpellE>i</span> need to transfer a char array from the client =
(java <span
class=3DSpellE>idl</span>) to the server (<span =
class=3DSpellE>omniORB</span>).
This message should have 121 elements. Therefore I created following =
<span
class=3DSpellE>idl</span> file:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span=
></font></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'>#<s=
pan
class=3DSpellE>ifndef</span> =
__ECHO_IDL__<o:p></o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'>#de=
fine
__ECHO_IDL__<o:p></o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'><o:=
p>&nbsp;</o:p></span></font></b></p>

<p class=3DMsoNormal><span class=3DGramE><b =
style=3D'mso-bidi-font-weight:normal'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'>int=
erface</span></font></b></span><b
style=3D'mso-bidi-font-weight:normal'><font size=3D2 face=3DArial><span =
lang=3DEN-US
style=3D'font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-US;font-=
weight:
bold;mso-bidi-font-weight:normal'> Echo =
{<o:p></o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'><sp=
an
style=3D'mso-spacerun:yes'>&nbsp; </span><span class=3DSpellE><span =
class=3DGramE>typedef</span></span>
sequence&lt;char,121&gt; <span =
class=3DSpellE>msg</span>;<o:p></o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'><sp=
an
style=3D'mso-spacerun:yes'>&nbsp; </span><span class=3DSpellE><span =
class=3DGramE>msg</span></span>
<span class=3DSpellE>testConnection</span>(in <span =
class=3DSpellE>msg</span> <span
class=3DSpellE>testConnection</span>);<o:p></o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'>};<=
o:p></o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'><o:=
p>&nbsp;</o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'>#<s=
pan
class=3DSpellE>endif</span><o:p></o:p></span></font></b></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'><o:p>&nbsp;</o:p></span=
></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>The problem is hat =
<span
class=3DSpellE>i</span> do not know how I can write into these <span
class=3DSpellE><span class=3DGramE>sequenz</span></span><span =
class=3DGramE>(</span>array)<o:p></o:p></span></font></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>I think that this line =
from
the <span class=3DSpellE>xxxSK.cpp</span> is important form e but <span
class=3DSpellE>i</span> am not able to understand <span class=3DGramE>it =
:</span><o:p></o:p></span></font></p>

<p class=3DMsoNormal><span class=3DSpellE><b =
style=3D'mso-bidi-font-weight:normal'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'>Ech=
o::msg</span></font></b></span><b
style=3D'mso-bidi-font-weight:normal'><font size=3D2 face=3DArial><span =
lang=3DEN-US
style=3D'font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-US;font-=
weight:
bold;mso-bidi-font-weight:normal'>* <span class=3DSpellE><span =
class=3DGramE>testConnection</span></span><span
class=3DGramE>(</span>const <span class=3DSpellE>Echo::msg</span>&amp; =
<span
class=3DSpellE>testConnection</span>);<o:p></o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'><o:=
p>&nbsp;</o:p></span></font></b></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>In the echo example =
this line
looks like that:<o:p></o:p></span></font></p>

<p class=3DMsoNormal><span class=3DGramE><b =
style=3D'mso-bidi-font-weight:normal'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'>cha=
r</span></font></b></span><b
style=3D'mso-bidi-font-weight:normal'><font size=3D2 face=3DArial><span =
lang=3DEN-US
style=3D'font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-US;font-=
weight:
bold;mso-bidi-font-weight:normal'>* <span =
class=3DSpellE>testConnection</span>(const
char* <span class=3DSpellE>msg</span>);<o:p></o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'><o:=
p>&nbsp;</o:p></span></font></b></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>For this line in the =
example
file the c code to save something in this variable is easy to =
understand<o:p></o:p></span></font></p>

<p class=3DMsoNormal><span class=3DGramE><b =
style=3D'mso-bidi-font-weight:normal'><font
size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'>vir=
tual</span></font></b></span><b
style=3D'mso-bidi-font-weight:normal'><font size=3D2 face=3DArial><span =
lang=3DEN-US
style=3D'font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-US;font-=
weight:
bold;mso-bidi-font-weight:normal'> char* <span =
class=3DSpellE>incomingMsg</span>(const
char* <span =
class=3DSpellE>mesg</span>);<o:p></o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'><o:=
p>&nbsp;</o:p></span></font></b></p>

<p class=3DMsoNormal><font size=3D2 face=3DArial><span lang=3DEN-US =
style=3D'font-size:
10.0pt;font-family:Arial;mso-ansi-language:EN-US'>I can use <span =
class=3DSpellE>msg</span>
in all my methods and <span class=3DSpellE>i</span> am able to return a =
string:<b
style=3D'mso-bidi-font-weight:normal'><span =
style=3D'font-weight:bold;mso-bidi-font-weight:
normal'> return <span class=3DSpellE>CORBA::string_<span =
class=3DGramE>dup</span></span><span
class=3DGramE>(</span>&quot;<span class=3DSpellE>Hier</span> <span =
class=3DSpellE>ist</span>
die <span class=3DSpellE>Funktion</span> <span =
class=3DSpellE>testConnection</span>&quot;);<o:p></o:p></span></b></span>=
</font></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'><o:=
p>&nbsp;</o:p></span></font></b></p>

<p class=3DMsoNormal><u><font size=3D2 face=3DArial><span lang=3DEN-US
style=3D'font-size:10.0pt;font-family:Arial;mso-ansi-language:EN-US'>I =
do not
understand this with the created sequence in the <span =
class=3DSpellE>idl</span>
file. How can I access <span class=3DSpellE><span =
class=3DGramE>testConnection</span></span><span
class=3DGramE> ????</span><o:p></o:p></span></font></u></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'><o:=
p>&nbsp;</o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'><o:=
p>&nbsp;</o:p></span></font></b></p>

<p class=3DMsoNormal><b style=3D'mso-bidi-font-weight:normal'><font =
size=3D2
face=3DArial><span lang=3DEN-US =
style=3D'font-size:10.0pt;font-family:Arial;
mso-ansi-language:EN-US;font-weight:bold;mso-bidi-font-weight:normal'>Tha=
nks Christian<o:p></o:p></span></font></b></p>

</div>

</body>

</html>

------=_NextPart_000_0001_01C184AE.A98D7300--