When you use the DataObject domain with CORBA, you need to know how XML schema and ESQL types correspond to the types in the IDL file.
IDL | XML schema | ESQL |
---|---|---|
boolean | xsd:boolean | BOOLEAN |
char | <xsd:simpleType name="char"> |
CHARACTER |
wchar | <xsd:simpleType name= “wchar”> |
CHARACTER |
double | xsd:double | FLOAT |
float | xsd:float | FLOAT |
octet | xsd:unsignedByte | INTEGER |
long | xsd:int | INTEGER |
Long long | xsd:long | INTEGER |
short | xsd:short | INTEGER |
string | xsd:string | CHARACTER |
wstring | xsd:string | CHARACTER |
Unsigned short | xsd:unsignedShort | INTEGER |
Unsigned long | xsd:unsignedInt | INTEGER |
Unsigned long long | xsd:unsignedLong | DECIMAL |
enum myEnum {A, B, C};
interface example {
void myoperation(in myEnum input1);
};
Here is an example XML schema:<xsd:simpleType name=”myEnum”>
<xsd:restriction base=”xsd:string”>
<xsd:enumeration value=”A”/>
<xsd:enumeration value=”B”/>
<xsd:enumeration value=”C”/>
</xsd:restriction>
</xsd:simpleType>
Here is an XML example:<example.myoperation>
<input1>A</input1>
</example.myoperation>
Typedef long myLong;
typedef sequence<long> longSeq;
interface example {
void myoperation(in longSeq input1, inout myLong input2);
};
Here is an example XML schema:<xsd:complexType name="longSeq">
<xsd:sequence>
<xsd:element name="item" minOccurs="0" maxOccurs="unbounded" type="xsd:int"/>
</xsd:sequence>
</xsd.complexType>
A sequence can be bounded with the
syntax sequence<long, 10>, which puts a bound in the XSD file.<example.myoperation>
<input1>
<item>10</item>
<item>11</item>
<item>12</item>
</input1>
</example.myoperation>
struct myStruct {
char c;
string str;
octet o;
short s;
unsigned long long ull;
float f;
double d;
};
interface example {
void myoperation(in myStruct input1);
};
<xsd:complexType name="myStruct">
<xsd:sequence>
<xsd:element name="c" type="xsd:string" maxOccurs="1" minOccurs="1"/>
<xsd:element name="str" type="xsd:string" nillable="true" maxOccurs="1" minOccurs="1"/>
<xsd:element name="o" type="xsd:byte" maxOccurs="1" minOccurs="1"/>
<xsd:element name="s" type="xsd:short" maxOccurs="1" minOccurs="1"/>
<xsd:element name="ull" type="xsd:unsignedLong" maxOccurs="1" minOccurs="1"/>
<xsd:element name="f" type="xsd:float" maxOccurs="1" minOccurs="1"/>
<xsd:element name="d" type="xsd:double" maxOccurs="1" minOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
Here is an XML example:<example.myoperation>
<input1>
<c>c</c>
<str>hello</str>
<o>12</o>
<s>10</s>
<ull>110</ull>
<f>12.0</f>
<d>12.1</d>
</input1>
</example.myoperation>
ModuleName.InterfaceName.OperationName
The following example shows a module in an IDL file.Module one {
Interface OneAInterface {
};
};
The fully qualified name of the interface called OneAInterface
is one.OneAInterface. In an IDL file, modules can
be nested in other modules. In this case, the fully qualified name
of the interface can include more than one module name, starting from
the root module; for example:ModuleNameA.ModuleNameB.InterfaceName.OperationName
An IDL file can contain more than one operation with the same name provided that the operations are in different modules.