[omniORB] Create org::omg::boxedRMI::seq1_octet_var Variable in C++
(octet per byte[])
Jim Reilly
jamesmreilly at yahoo.com
Fri Dec 12 12:14:41 GMT 2008
I'm new to CORBA and extrememly rusty to C++ (especially to MS Visual Studio 2008).
I created 1 UML class in Visual Paradigm (VP) (UML Tool) with one method, then generated IDL from it (I do not know IDL).
Here is the method:
public void sendThem(byte[] bytesToSend)
[notice the byte[])
My objective is to send from a Corba C++ client (stub) a byte arrry to a Corba Java service (skeleton).
NOTE: I have already been able to basically have this same method work, but sending a 'Long' vs a byte[]. So,
I have some successful experience getting it to work.
VP created 2 IDL files: TestService.idl and seq1_octet.idl. (NOT sure why 2, meaning the seq1_octet)
After using omniidl to create c++ source and idlj to create java source, and used the template of \omniORB-4.1.3\src\examples\echo\eg3_clt.cc (from examples) (It uses the COSS naming service to obtain the object reference) to kick start my client [as I did already correctly with the 'Long' parameter test noted above].
>From the example in : eg3_clt.cc as a basis, the problem I am having is trying to create (hardcode for now) an octet that will work with org::omg::boxedRMI::seq1_octet. Per this c++ SK method
void springfw::_objref_TestService::sendThem(org::omg::boxedRMI::seq1_octet* aBytesToSend)\
When calling it, I want to do this:
e->sendThem(buf);
How do I create my buf variable?
These do NOT work: (or combinations there-for of)
org::omg::boxedRMI::seq1_octet_var buf;
buf = 055;
CORBA::Octet *p = new CORBA::Octet[7];
buf = *p;
Octet oct = 040;
CORBA::OctetSeq_var src = oct;
Any help would be much apprecaiged!!!!!!!!!!!!!!
The error on the compile, is this:
1>c:\backup\cpp\pubber\pubber\pubber.cpp(64) : error C2679: binary '=' : no operator found which takes a right-hand operand of type 'int' (or there is no acceptable conversion)
1> c:\downloadextract\omniorb-4.1.3\include\omniorb4\valuetemplatedecls.h(106): could be '_CORBA_Value_Var<T,T_Helper> &_CORBA_Value_Var<T,T_Helper>::operator =(T *)'
.....
that points to this line:
buf = 01;
where buf is defined like this:
org::omg::boxedRMI::seq1_octet_var buf; (above where I assign it to 01)
NOTE: Weird thing is if I set buf = 00, it all works (no compile problem), but on the java corba svc side, it spits out null when I output what it receives..
Any ideas?????
(That is how do I instantiate a buf of type: org::omg::boxedRMI::seq1_octet_var or whatever...???????)
Thanks,
Jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.omniorb-support.com/pipermail/omniorb-list/attachments/20081212/7ad50e3d/attachment.htm
More information about the omniORB-list
mailing list