I am new to Slice2Java. I need to connect to an ice file from java. For that what are the steps, I need to follow.
Thanks
0
matthewNL, CanadaMemberMatthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine✭✭✭
What do you mean connect to an ice file from Java? If you want a complete example, take a look at any of the Ice demos. The simplest is demo/Ice/minimal.
The examples under demo/ice/minimal tell about the cpp files, I m looking for java examples. Can you please tell me all the steps to convert an .ice file to java?.
0
dwayneSt. John's, NewfoundlandMemberDwayne BooneOrganization: ZeroC, Inc.Project: Internet Communications Engine✭
The java demos can be found in multiple places:
* In the Ice 3.3 source distribution they can be found in the java/demo subdirectory.
* In the Windows binary installers they are in the demoj subdirectory.
* In the demo distribution for Unix they are also found in the demoj subdirectory.
Each of these distributions also contain README/INSTALL files that include instructions for building and running the demos.
If I convert Ice file into java file. Do I have to write a client and server? Also, do I have to write build.xml file or slice2java automatically generates build.xml file to run the Ice file. Please correct me . I'm using eclipse as IDE.
Thanks
0
matthewNL, CanadaMemberMatthew NewhookOrganization: ZeroC, Inc.Project: Internet Communications Engine✭✭✭
slice2java translates the a Slice file (.ice) file into corresponding java source files according to the rules defined in the Java language mapping section of the Ice manual. How exactly you do this depends on your build environment. We use ant, hence the build.xml files contained in our demo distribution. If you do not use ant, then you have to determine a suitable method to do this with your build environment.
Hi, I'm using the minimal example. I have copied all the files except build.xml into my project using eclipse and generated java files. After doing this , Do I have to run the ant to generate build.xml file.
struct Itm
{
int ItemNum; string ItemText;
};
sequence<Itm> Itms;
I'm working in java. I wanted to convert Itm to string in java. Is it possible?
Please let me know
thanks
0
michiMemberMichi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-)✭✭✭
There is no built-in feature to turn a Slice sequence into a string. You can write your own method that iterates over the sequence and stringifies it.
Alternatively, you can compile the Slice definition with --stream and use the generated helper class to serialize the sequence into a byte stream. You could then encode the result using a base-64 encoding or some such.
See the Dynamic Ice chapter in the manual for more info.
Comments
Hi,
I am new to Slice2Java. I need to connect to an ice file from java. For that what are the steps, I need to follow.
Thanks
The examples under demo/ice/minimal tell about the cpp files, I m looking for java examples. Can you please tell me all the steps to convert an .ice file to java?.
* In the Ice 3.3 source distribution they can be found in the java/demo subdirectory.
* In the Windows binary installers they are in the demoj subdirectory.
* In the demo distribution for Unix they are also found in the demoj subdirectory.
Each of these distributions also contain README/INSTALL files that include instructions for building and running the demos.
If I convert Ice file into java file. Do I have to write a client and server? Also, do I have to write build.xml file or slice2java automatically generates build.xml file to run the Ice file. Please correct me . I'm using eclipse as IDE.
Thanks
Hi, I'm using the minimal example. I have copied all the files except build.xml into my project using eclipse and generated java files. After doing this , Do I have to run the ant to generate build.xml file.
Thanks
Hi,
In the ice file, I have something as follows.
interface Resr
{
["nonmutating"] idempotent FileSystemPr::PrStruct getPr(string RecLocator) throws PrException;
OptPr setPrXdr(Ice::ByteSeq xdrPnr) throws PrException;
}
From this I understood that in the interface resr it calls getPr which returns PrStruct of the FileSystemPr.ice . Is that correct ?
Also I want to know what is nonmutating and idempotent means.
Thanks
For the slice language look at chapter 4: The Slice language. http://www.zeroc.com/doc/Ice-3.3.0/manual/Slice.html#49350
For idempotent see http://www.zeroc.com/doc/Ice-3.3.0/manual/Overview.3.2.html (look for "At-Most-Once Semantics"). For nonmutating look at http://www.zeroc.com/doc/Ice-3.3.0/reference/Ice/OperationMode.html. Note that nonmutating is deprecated and should not be used any longer.
I have a struct in a ice file like below
struct Itm
{
int ItemNum; string ItemText;
};
sequence<Itm> Itms;
I'm working in java. I wanted to convert Itm to string in java. Is it possible?
Please let me know
thanks
Alternatively, you can compile the Slice definition with --stream and use the generated helper class to serialize the sequence into a byte stream. You could then encode the result using a base-64 encoding or some such.
See the Dynamic Ice chapter in the manual for more info.
Cheers,
Michi.