I am trying to set up a very simple client/server system. The clients
are policemen and the server is a police database with details of criminals.
I want to store the offences by each criminal as an array of strings.
The police can then add extra strings to this array as the criminal
commits offences in the future.
My code is here:
www.dur.ac.uk/z.a.craven/temp/
Can someone please explain why it isn't working? I think the problem is
with the IDL file where I define the array.
"mameha" <zaccraven@hotmail.com> wrote...
>I am trying to set up a very simple client/server system. The clients are
>policemen and the server is a police database with details of criminals.
[quoted text clipped - 7 lines]
>
> Can someone please explain why it isn't working?
"Working" is a relative concept...
My guess is that it didn't even work to generate stubs and skeletons from
the IDL-file with idlj?
> I think the problem is with the IDL file where I define the array.
CORBA IDL doesn't have this type of fixed arrays (not when I looked at it
last anyway).
To define an array you have to use the type "sequence", as in
typedef sequence<OffenceRecord> OffenceList;
...and consequently use that as a "listtype", eg in your struct:
struct CriminalObject {
string name;
long id_number;
OffenceList offence_list;
};
This will show up in the generated Java-code as regular arrays.
Just as in Java, the variable doesn't have a length for the array. The
array-instance does.
// Bjorn A
mameha - 02 Feb 2005 18:27 GMT
> "mameha" <zaccraven@hotmail.com> wrote...
>
[quoted text clipped - 38 lines]
>
> // Bjorn A
thank you that is useful.
zac