473,322 Members | 1,287 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

[CORBA, Visibroker, C++] Array, sequence problem.

Hi
I've got my CORBA application written in Borland C++ Builder, using
Visibroker. What I wanna do is get from server a set of strings (the number
of string is not constant). I was trying to do it with sequence but got some
problems. Here is the method i IDL:

long get_clerks_list (out workerseq loginnames);

where long is number of strings in loginnames
and
typedef sequence<long> workerseq;

Could anybody give me a simple example how to write a server function
(puting 'aaa', 'bbb', 'ccc' and returning it), and how to use it by client.
I'll compare it to my code and find out what's wrong.

Thanks in advance
Chris
Jul 22 '05 #1
2 3649
"Krzysztof Opała" <ko****@kszo.ostrowiec.pl> wrote in message news:<cg**********@druid.ceti.pl>...
I've got my CORBA application written in Borland C++ Builder, using
Visibroker. What I wanna do is get from server a set of strings (the number
of string is not constant). I was trying to do it with sequence but got some
problems. Here is the method i IDL:

long get_clerks_list (out workerseq loginnames);

where long is number of strings in loginnames
and
typedef sequence<long> workerseq;

Could anybody give me a simple example how to write a server function
(puting 'aaa', 'bbb', 'ccc' and returning it), and how to use it by client.
I'll compare it to my code and find out what's wrong.


I assume workerseq is a sequence of string, not a sequence of long.

CORBA::Long
YourServantClass::get_clerks_list(workerseq_out loginnames)
throw(CORBA::SystemException) {
workerseq_var ws = new workerseq(3);
ws->length(3);
ws[0] = CORBA::string_dup("aaa");
ws[1] = CORBA::string_dup("bbb");
ws[2] = CORBA::string_dup("ccc");
loginnames = ws._retn();
return loginnames->length();
}

Assuming the client already has an object reference to your object, it
does something like this:

workerseq_var ws;
CORBA::Long len = objref->get_clerks_list(ws.out());
cout << "first entry is " << ws[0] << endl;

See "Advanced CORBA Programming with C++" for more details
(http://www.iona.com/hyplan/vinoski/).

--steve
Jul 22 '05 #2
"Steve Vinoski" <vi*****@ieee.org> wrote in message
news:6c*************************@posting.google.co m...
"Krzysztof Opała" <ko****@kszo.ostrowiec.pl> wrote in message

news:<cg**********@druid.ceti.pl>...
I've got my CORBA application written in Borland C++ Builder, using
Visibroker. What I wanna do is get from server a set of strings (the number of string is not constant). I was trying to do it with sequence but got some problems. Here is the method i IDL:

long get_clerks_list (out workerseq loginnames);

where long is number of strings in loginnames
and
typedef sequence<long> workerseq;

Could anybody give me a simple example how to write a server function
(puting 'aaa', 'bbb', 'ccc' and returning it), and how to use it by client. I'll compare it to my code and find out what's wrong.


I assume workerseq is a sequence of string, not a sequence of long.

CORBA::Long
YourServantClass::get_clerks_list(workerseq_out loginnames)
throw(CORBA::SystemException) {
workerseq_var ws = new workerseq(3);
ws->length(3);
ws[0] = CORBA::string_dup("aaa");
ws[1] = CORBA::string_dup("bbb");
ws[2] = CORBA::string_dup("ccc");
loginnames = ws._retn();
return loginnames->length();
}

Assuming the client already has an object reference to your object, it
does something like this:

workerseq_var ws;
CORBA::Long len = objref->get_clerks_list(ws.out());
cout << "first entry is " << ws[0] << endl;

See "Advanced CORBA Programming with C++" for more details
(http://www.iona.com/hyplan/vinoski/).

--steve


Thanks a lot for your answer. It's going to be better but I still got one
big problem. While calling my method from client - the client throw
"External exception EEFFACE". What is strange - I call other methods from
the same interface and they're doing well. Have you got any idea ?

BTW: Of course workerseq is a sequence of string :)

Regards
Chris
Jul 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Dan | last post by:
Hello there. I have recently been tasked with creating a mySql database. I am much more used to using Oracle, so I guess my problem is translating Oracle into mySql. My current problem is the...
5
by: Paul | last post by:
The problem I am having involves the sequence of events between frames in an html page. The Pages: Page A has an imbedded IFrame which displays Page B. Page A has a radio button which on...
2
by: Stephan Parrot | last post by:
Hello people! I have a really weird problem here... Let's say i have 4 lines of codes in a function like this one: SomeSVGDialog.Show(); //this is an SVG dialog box that shows to give some...
10
by: dof | last post by:
I'm trying the following and having problems. I get errors on the array declaration lines. Something about an array must have at least one element. Thanks in advance. D #include stuff .... ...
2
by: Sergey Poberezovskiy | last post by:
Hi, If I define my schema as <xs:choice> <xs:sequence> <xs:element ref="el_1" /> <xs:element ref="el_2" /> </xs:sequence> <xs:sequence>
4
by: Sumit | last post by:
Hi all, I am working on an application in which there is a form which has a tabcontrol containing 4 tab pages. Let the name of the tabpages be A,B,C&D. The default view is that there are all...
0
by: HelmutStoneCorner | last post by:
Hi, I am connected as a german client to a multilanguage server, Regional Options: English, US. Western Europe and US. The W2K Server (Terminal) -version: english(US) runs a french database. My...
0
by: news.onet.pl | last post by:
I hava a problem with communication between Java/Corba server based on JDK ORB with Java/Corba client (applet) based on the same ORB. I`m using IOR to localize server. client`s ORB i initialize...
2
by: Geneman | last post by:
I created a simple database with about 10 fields. I entered an initial 1866 records into that database in order and each got assigned an autonumber. These records are from a cemetery and are...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.