This section describes the datatypes supported in WST. The datatype must belong to a supported component type for it to be available as a Web service. Supported datatypes include:
JAX-RPC defined data types – Refer to chapter four (WSDL/XML to Java Mapping) and five (Java to XML/WSDL Mapping) of the Java API for XML-based RPC JAX-RPC 1.0 specification. See the JAX-RPC download site
Java with IDL datatypes – the component’s method declarations use the datatype mappings that are specified by the CORBA document, IDL to Java Language Mapping Specification (formal/99-07-53).
CORBA C++ with IDL datatypes – the component’s method declarations use the OMG standard for translating CORBA IDL to C++. For more specifics, see C++ Language Mapping Specification (formal/99-07-41). You can download this document from the OMG Web site. C++ datatype mappings are the same as the Java/IDL component datatype mappings that are listed in Table 3-1.
Table 3-1 lists the datatypes supported in WST and EAServer and corresponding PowerBuilder types. Exposing a component as a Web service does not require you to regenerate its remote interface. EAServer uses JAX-RPC mapping rules to generate EJB remote interfaces.
CORBA IDL type |
Parameter mode |
CORBA/Java type |
EJB parameter type |
PowerBuilder types |
---|---|---|---|---|
boolean |
in, return |
boolean |
boolean |
Boolean by value |
out, inout |
org.omg.CORBA.BooleanHolder |
javax.xml.rpc.holders.BooleanHolder |
Boolean by reference |
|
char |
in, return |
char |
char (see note 9) |
Char by value |
out, inout |
org.omg.CORBA.CharHolder |
N/A (see note 1) |
Char by reference |
|
octet |
in, return |
byte |
byte |
Char by value (see note 2) |
out, inout |
org.omg.CORBA.ByteHolder |
javax.xml.rpc.holders.ByteHolder |
Char by reference (see note 2) |
|
short |
in, return |
short |
short |
Integer by value |
out, inout |
org.omg.CORBA.ShortHolder |
javax.xml.rpc.holders.ShortHolder |
Integer by reference |
|
long |
in, return |
int |
int |
Long by value |
out, inout |
org.omg.CORBA.IntHolder |
javax.xml.rpc.holders.IntHolder |
Long by reference |
|
long long |
in, return |
long |
long |
LongLong by value |
out, inout |
org.omg.CORBA.LongHolder |
javax.xml.rpc.holders.LongHolder |
LongLong by reference |
|
float |
in, return |
float |
float |
Real by value |
out, inout |
org.omg.CORBA.FloatHolder |
javax.xml.rpc.holders.FloatHolder |
Real by reference |
|
double |
in, return |
double |
double |
Double by value |
out, inout |
org.omg.CORBA.DoubleHolder |
javax.xml.rpc.holdersDoubleHolder |
Double by reference |
|
string |
in, return |
string |
string |
String by value |
out, inout |
org.omg.CORBA.StringHolder |
javax.xml.rpc.holders.StringHolder |
String by reference |
|
BCD::Binary |
in, return |
byte[] |
byte[] |
Blob by value |
out, inout |
BCD.BinaryHolder |
javax.xml.rpc.holders.ByteArrayHolder |
Blob by reference |
|
BCD:: Decimal |
in, return |
BCD.Decimal |
java.math.BigDecimal |
Decimal by value |
out, inout |
BCD.DecimalHolder |
javax.xml.rpc.holders.BigDecimalHolder |
Decimal by reference |
|
BCD:: Money |
in, return |
BCD.Money |
java.math.BigDecimal |
Decimal by value |
out, inout |
BCD.MoneyHolder |
javax.xml.rpc.holders.BigDecimalHolder |
Decimal by reference |
|
MJD::Date |
in, return |
MJD.Date |
java.util.Calendar |
Date by value |
out, inout |
MJD.DateHolder |
javax.xml.rpc.holders.CalendarHolder |
Date by reference |
|
MJD::Time |
in, return |
MJD.Time |
java.util.Calendar |
Time by value |
out, inout |
MJD.TimeHolder |
javax.xml.rpc.holders.CalendarHolder |
Time by reference |
|
MJD:: Timestamp |
in, return |
MJD.Timestamp |
java.util.Calendar |
DateTime by value |
out, inout |
MJD.TimestampHolder |
javax.xml.rpc.holders.CalendarHolder |
DateTime by reference |
|
XDT:: BooleanValue |
in, return |
XDT.BooleanValue |
java.lang.Boolean |
XDT_BooleanValue by value |
out, inout |
XDT.BooleanValueHolder |
javax.xml.rpc.holders.BooleanWrapperHolder |
XDT_BooleanValue by reference |
|
XDT::CharValue |
in, return |
XDT.CharValue |
java.lang.Character (see note 9) |
XDT_CharValue by value |
out, inout |
XDT.CharValueHolder |
XDT.CharacterWrapperHolder (see note 1) |
XDT_CharValue by reference |
|
XDT::ByteValue |
in, return |
XDT.ByteValue |
java.lang.Byte |
XDT_ByteValue by value |
out, inout |
XDT.ByteValueHolder |
javax.xml.rpc.holders.ByteWrapperHolder |
XDT_ByteValue by reference |
|
XDT::ShortValue |
in, return |
XDT.ShortValue |
java.lang.Short |
XDT_ShortValue by value |
out, inout |
XDT.ShortValueHolder |
javax.xml.rpc.holders.ShortWrapperHolder |
XDT_ShortValue by reference |
|
XDT::IntValue |
in, return |
XDT.IntValue |
java.lang.Int |
XDT_IntValue by value |
out, inout |
XDT.IntValueHolder |
javax.xml.rpc.holders.IntegerWrapperHolder |
XDT_IntValue by reference |
|
XDT::LongValue |
in, return |
XDT.LongValue |
java.lang.Long |
XDT_LongValue by value |
out, inout |
XDT.LongValueHolder |
javax.xml.rpc.holders.LongWrapperHolder |
XDT_LongValue by reference |
|
XDT::FloatValue |
in, return |
XDT.FloatValue |
java.lang.Float |
XDT_FloatValue by value |
out, inout |
XDT.FloatValueHolder |
javax.xml.rpc.holders.FloatWrapperHolder |
XDT_FloatValue by reference |
|
XDT::DoubleValue |
in, return |
XDT.DoubleValue |
java.lang.Double |
XDT_DoubleValue by value |
out, inout |
XDT.DoubleValueHolder |
javax.xml.rpc.holders.DoubleWrapperHolder |
XDT_DoubleValue by reference |
|
XDT::DecimalValue |
in, return |
XDT.DecimalValue |
java.lang.BigDecimal |
XDT_DecimalValue by value |
out, inout |
XDT.DecimalValueHolder |
javax.xml.rpc.holders.BigDecimalHolder |
XDT_DecimalValue by reference |
|
XDT::IntegerValue |
in, return |
XDT.IntegerValue |
java.math.BigInteger |
XDT_IntegerValue by value |
out, inout |
XDT.IntegerValueHolder |
javax.xml.rpc.holders.BigIntegerHolder |
XDT_IntegerValue by reference |
|
XDT::DateValue |
in, return |
XDT.DateValue |
java.util.Calendar |
XDT_DateValue by value |
out, inout |
XDT.DateValueHolder |
javax.xml.rpc.holders.CalendarHolder |
XDT_DateValue by reference |
|
XDT::TimeValue |
in, return |
XDT.TimeValue |
java.util.Calendar |
XDT_TimeValue by value |
out, inout |
XDT.TimeValueHolder |
javax.xml.rpc.holders.CalendarHolder |
XDT_TimeValue by reference |
|
XDT::DateTimeValue |
in, return |
XDT.DateTimeValue |
java.util.Calendar |
XDT_DateTimeValue by value |
out, inout |
XDT.DateTimeValueHolder |
javax.xml.rpc.holders.CalendarHolder |
XDT_DateTimeValue by reference |
|
XDT::ByteArray |
in, return |
byte[] |
byte[] |
Blob by value |
out, inout |
XDT.ByteArrayHolder |
javax.xml.rpc.holders.ByteArrayHolder |
Blob by reference |
|
MyModule::MyException (exception) |
raises (throws) |
MyModule.MyException |
MyModule.ejb.MyException |
MyModule_MyException or MyException |
MyModule::MyComp (interface) |
in, return |
MyModule.MyComp |
MyModule.ejb.MyComp |
MyModule_MyComp or MyComp by value |
out, inout |
MyModule.MyCompHolder |
MyModule.ejb.MyCompHolder |
MyModule_MyComp or MyComp by reference |
|
MyModule::MyStruct (struct) |
in, return |
MyModule.MyStruct |
MyModule.ejb.MyStruct |
MyModule_MyStruct or MyStruct by value |
out, inout |
MyModule.MyStructHolder |
MyModule.ejb.MyStructHolder |
MyModule_MyStruct or MyStruct by reference |
|
MyModule::MyUnion (union) |
in, return |
MyModule.MyUnion |
MyModule.ejb.MyUnion |
MyModule_MyUnion or MyUnion by value |
out, inout |
MyModule.MyUnionHolder |
MyModule.ejb.MyUnionHolder |
MyModule_MyUnion or MyUnion by reference |
|
MyModule::MySequence (sequence<MyElement>) |
in |
MyModule.MyElement[] |
MyModule.ejb.MyElement[] |
MyModule_MyElement[] or MyElement[] by value |
return |
MyModule.MyElement[] |
MyModule.ejb.MyElement[] |
MyModule_MySequence or MySequence |
|
out, inout |
MyModule.MySequenceHolder |
MyModule.ejb.MySequenceHolder |
MyModule_MyElement[] or MyElement[] by reference |
|
MyModule::MyArray (MyElement[N]) (see note 3) |
in |
MyModule.MyElement |
MyModule.ejb.MyElement |
MyModule_MyElement[] or MyElement[] by value |
return |
MyModule.MyElement |
MyModule.ejb.MyElement |
MyModule_MyArray or MyArray |
|
out, inout |
MyModule.MyArrayHolder |
MyModule.ejb.MyArrayHolder |
MyModule_MyElement[N] or MyElement[N] by reference |
|
TabularResults::ResultSet (see note 4) |
in, return |
TabularResults.ResultSet |
java.sql.ResultSet |
ResultSet by value |
out, inout |
TabularResults.ResultSetHolder |
N/A |
ResultSet by reference |
|
TabularResults::ResultSet (see note 4) |
in, return |
TabularResults.ResultSet[] |
java.sql.ResultSet[] |
ResultSet by value |
out, inout |
TabularResults.ResultSetHolder |
N/A |
ResultSet by reference |
The ‘char’ and ‘java.lang.Charcter’ data types have no defined XML Schema mapping for EJB Web services, and should not be used as a parameter type or structure field type if you plan to expose components as Web services.
PowerBuilder version 10.5 introduced a Byte data type. To use the PB Char data type for backwards compatibility, run this command (once) before deployment:
configure idl-octet-to-pb-char
To switch back to using the PB Byte data type, run this command (once) before deployment:
configure idl-octet-to-pb-byte
IDL fixed size array types have no defined XML Schema mapping for EJB Web services, and should not be used as parameter types or structure field types if you plan to expose components as Web services. Use IDL sequences types instead (Java arrays, PowerBuilder variable sized arrays).
The ‘ResultSet’ data type should not be used with the PB Server Plugin if you plan to expose components as Web services, because java.sql.ResultSet is not portable in EJB Web service endpoint interfaces. Use IDL sequences of structures instead (Java arrays, PowerBuilder variable sized arrays). For EAServer, EJB return type java.sql.ResultSet maps to a complex schema element that contains the result set data and the schema for the result set. The content of the XML is mapped according to the SQL/XML ANSI standard.
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="jdbc.wst.sybase.com"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/" /> <complexType name="DataReturn"> <sequence> <element name="XML" nillable="true" type="xsd:string" /> <element name="updateCount" type="xsd:int" /> <element name="DTD" nillable="true" type="xsd:string" /> <element name="schema" nillable="true" type="xsd:string" /> </sequence> </complexType> </schema>
Using IDL parameter modes ‘inout’ and ‘out’ with TabularResults::ResultSet(s) is not supported for exposing components as Web services.
Using arrays (IDL sequences) of structures instead of result sets simplifies coding of Web service client applications since it is portable across all application servers. When you write PowerBuilder NVO methods, which do not permit using arrays as method return types, define a row structure to represent a result row, and a table structure containing an array of row structures to represent a result set.
Do not use IDL ‘inout’ and ‘out’ parameter modes with the PowerBuilder server plugin, because JAX-RPC holder classes are not portable in EJB remote interfaces. For EAServer, use ‘inout’ and ‘out’ parameter modes (with the exceptions listed in note 4). When PowerBuilder components are deployed, any “by reference” parameters are mapped to IDL parameter mode ‘inout’. Therefore PowerBuilder “by reference” parameters should not be used with the PowerBuilder server plugin.
The PowerBuilder NVO deployment option “Allow NULL values in method parameters” is not supported if you intend to expose components as web services. It is also not supported when using the PB Server Plugin (see note 10).
The default mapping of CORBA IDL identifiers to Java/EJB identifiers can be modified to use Java naming conventions. This is called the “camel case” deployment option. When using this option, IDL operation and parameter names such as “abc_xyz” map to “abcXyz”, and IDL interfaces, sequence, structure, and union type names “abc_xyz” map to “AbcXyz”. This mapping is not applied to exception and structure field names.
To enable the “camel case” option, use this command:
configure camel-case-on
To disable the “camel case” option, use this command:
configure camel-case-off
If you intend to expose components as Web services, you should enable the “camel case” option, otherwise you might encounter problems with the JAX-RPC identifier mapping rules (See the JAX-RPC 1.1 specification, chapter 20 “Appendix: Mapping of XML Names”).
For CORBA C++ data types, see the CORBA IDL to C++ Language Mapping document http://www.omg.org/technology/documents/formal/c++.htm
Only characters in the ISO 8859-1 character set can be used in this case. Use the String type to propagate other characters.
To obtain the PowerBuilder XDT_* data types for use as PB structure field types or component parameter types, use the “EAServer Proxy Wizard” or “Application Server Proxy Wizard” in the PowerBuilder IDE to generate proxies for the “XDT” package. Each of the XDT_* data types contains a value field and an isNull field. The isNull field must be set to true to indicate a null value.
Exposing PowerBuilder components as Web services where the component passes an array of simple types by reference is not supported.
Exposing CORBA Components as Web services where the component passes a sequence of simple types as inout parameters is not supported.
Instead you should pass IDL sequences of user-defined structure types using IDL inout or out parameters. Also see note 7.