IDLToWSDLDevPlan

Summary of Requirements Being Addressed

A tool that can take an idl file and generate a wsdl with a corba binding.

Summary of Proposed Solution

The proposed solution is to use antlr with the idl grammar file to implement a visitor pattern based generation of the corresponsing wsdl file.

The mappings for the idl to wsdl types is defined here: IdlToWsdlTypeMapping.

Following external projects have been used to implement this tool.

jwsdl: To create a wsdl model in memory from the idl.

XMLSchema: To create the xml schema types from the idl types.

celtix: Framework for creating the tool like parsing of the tool options, helper classes to register extensions with the jwsdl model, etc...

For each set of tasks we need to setup and write unit tests and system tests. Make sure it conforms to checkstyle. We need to conform to the coding standard used in Yoko.

Stories to be done for type support

List of different types that need to be supported

Description

Primitive type support

Support for simple sequence and Enum

Support for basic sequence with tests

Support for basic struct with tests

Support for basic exception with tests

Support for basic union with tests

Support for basic enum with tests

Support for basic array with tests

Support for typedef array with tests

Support for union with tests

Support for anon types with tests

Support for nested with tests

Support for basic recursion with tests

Support for basic fixed with tests

Support for basic any with tests

Support for basic consts with tests

Support for date/time with tests

Support for idl interfaces as references

Tests for the type support for the WSDL Corba binding generation

Recursive types support development plan

idltowsdl tool

According to the CORBA 2.6 spec:

"The IDL syntax allows the generation of recursive structures and unions via members that have a sequence type. The element type of a recursive sequence struct or union member must identify a struct, union, or valuetype."

Since we do not support valuetypes, we only need to worry about recursive struct and union.

"Forward declarations are legal for structures and unions. A structure or union type is termed incomplete until its full definition is provided."

"An incomplete type can only appear as the element type of a sequence definition. A sequence with incomplete element type is termed an incomplete sequence type"
struct Foo; // Forward declaration
typedef sequence<Foo> FooSeq; // incomplete

"An incomplete sequence type can appear only as the element type of another sequence, or as the member type of a structure or union definition."

For example:

struct Foo; // Forward declaration
typedef sequence<Foo> FooSeq; // OK
typedef sequence<FooSeq> FooTree; // OK

In other words, we only need to worry about structures or unions that contain incomplete sequences.

Example 1:

// recursive struct containing an anonymous sequence
struct Foo {
    long value;
    sequence<Foo> chain;
}

Example 2:

// forward declaration, named sequence, recursive struct
struct Foo;
typedef sequence<Foo> FooSeq;
struct Foo {
    long value;
    FooSeq chain;
};

Example 3:

union Bar; // Forward declaration
typedef sequence<Bar> BarSeq;
union Bar switch(long) { // Define incomplete union
  case 0:
    long l_mem;
  case 1:
    struct Foo {
        double d_mem;
        BarSeq nested; // OK, recurse on enclosing
                       // incomplete type
    } s_mem;
};

Example 2 should map to the following:

XmlSchema
 <complexType name="FooSeq">
    <sequence>
        <element maxOccurs="unbounded" minOccurs="0" name="item"
            type="Foo"/>
    </sequence>
</complexType>
<complexType name="Foo">
    <sequence>
        <element name="value" type="int"/>
        <element name="chain" type="FooSeq"/>
    </sequence>
</complexType>
CorbaTypeMap
 <corba:sequence bound="0" elemtype="Foo" name="FooSeq"
    repositoryID="IDL:FooSeq:1.0" type="xsd:FooSeq"/>
<corba:struct name="Foo" repositoryID="IDL:Foo:1.0" type="xsd:Foo">
    <corba:member idltype="corba:long" name="value"/>
    <corba:member idltype="FooSeq" name="chain"/>
</corba:struct>

wsdltoidl

The wsdltoidl tool should be able to recognise and translate the recursive types that originated from legal IDL recursive types.

(Can anyone comment on the following paragraph? Is this correct? Can anyone provide an example?)

The set of recursive XmlSchema types that can be generated by legal IDL recursive types is contained within the set of recursive XmlSchema types. The wsdltoidl should generated a warning when parsing a recursive XmlSchema type that cannot be mapped into a recursive IDL type.

  • No labels