IDL to WSDL code generation
This component is based on this simple pseudo equation: idj2java + java2wsdl = idl2wsdl. This generation is used for both the WSDL generation (used to configure Jb4Corba endpoints) and for the runtime behaviour for both the
provider
and the
consumer from IDL 
.
The algorithm used is the following:
1. idlj
The first step is the "IDL to Java" code generation.
To implement this operation the component uses a Sun's tool
distributed with the standard JDK: idlj.
This tool has several options and if you want a more detailed discussion
about it, please visit the java.sun.com
.
The command line used is
idlj -fall -td targetdir -i includedir file.idl
where targetdir is the directory to place the source files
and includedir is the directory where the IDL file is located.
com.sun.tools.corba.se.idl.toJavaPortable.Compile.main(
new String[] { "-fall",
"-td",
targetdir,
"-i",
includedir,
idlFilename });
At the end, if the IDL is correct, in the targetdir there are the java source files just generated. In the consumer from IDL
case, idlj is used with the -fallTIE parameter to create the poaTie class.
2. Value type implementation
If the IDL file contains one or more value types the source files
produced don't compile, in fact the developers must supply an
implementation class for each value type.
For example:
If you have an IDL file that contains a value type like the following
valuetype FooValueType {
public short fooField;
};
We generate 2 classes: the class of the value type
public abstract class FooValueType
implements org.omg.CORBA.portable.StreamableValue {
// ... some code
}
... and the Factory
public class FooValueTypeDefaultFactory
implements org.omg.CORBA.portable.ValueFactory {
public java.io.Serializable read_value (
org.omg.CORBA_2_3.portable.InputStream is) {
return is.read_value(new FooValueTypeImpl ());
}
}
But the class FooValueTypeImpl does not exist so we generate an
empty class that extends FooValueType and called FooValueTypeImpl
in the source's directory.
public class FooValueTypeImpl extends FooValueType {
}
Now the code generated compiles!
3. Compiling
Compiling the java source code generated using javac.
4. Bytecode manipulation
The compiled code generated is not ready to be used by CXF, so we
inspect all the
Operations class (generated from the CORBA interface)
and extract from this class all the data types used in the methods.
For each data types found we modify their bytecode to comply the CXF
behaviour:
- for each public or protected member we add the getter and setter method;
- if the class is abstract we remove this keyword;
- we append to the default constructor the code to istantiate the array (if the class contains one or more array) to avoid NullPointerException.
5. CXF
Now, the classes are ready to be analyzed by CXF to generate the
related WSDL.
This page (revision-32) was last changed on
29-Jun-09 02:56 AM, -0700
by 213.174.165.189.
This page was created on
27-Apr-07 08:01 AM, -0700 by 213.174.165.189.
More info...
| Version |
Date |
Author |
Size |
Changes ... |
|
32
|
29-Jun-09 02:56 AM, -0700
|
213.174.165.189 |
4138 |
to previous
|
|
31
|
29-Jun-09 02:52 AM, -0700
|
213.174.165.189 |
4132 |
to previous
|
to last
|
|
30
|
26-Jun-09 07:58 AM, -0700
|
213.174.165.189 |
4132 |
to previous
|
to last
|
|
29
|
26-Jun-09 07:56 AM, -0700
|
213.174.165.189 |
4056 |
to previous
|
to last
|
|
28
|
26-Jun-09 07:50 AM, -0700
|
213.174.165.189 |
3981 |
to previous
|
to last
|
|
27
|
26-Jun-09 07:39 AM, -0700
|
213.174.165.189 |
3906 |
to previous
|
to last
|
|
26
|
03-Apr-08 00:07 AM, -0700
|
213.174.165.189 |
3615 |
to previous
|
to last
|
|
25
|
02-Apr-08 06:11 AM, -0700
|
213.174.165.189 |
3612 |
to previous
|
to last
|
|
24
|
02-Apr-08 06:01 AM, -0700
|
213.174.165.189 |
3615 |
to previous
|
to last
|
|
23
|
02-Apr-08 05:59 AM, -0700
|
213.174.165.189 |
3617 |
to previous
|
to last
|
|
22
|
01-Apr-08 02:13 AM, -0700
|
213.174.165.189 |
3619 |
to previous
|
to last
|
|
21
|
01-Oct-07 12:36 PM, -0700
|
MarkWhite |
3623 |
to previous
|
to last
|
|
20
|
25-Sep-07 15:15 PM, -0700
|
ErbasEltel |
3650 |
to previous
|
to last
|