uCosminexus Application Server, Web Service Development Guide

[Contents][Glossary][Index][Back][Next]

15.1.4 Mapping a message part to a parameter and return value (For wrapper style)

This subsection describes the mapping of WSDL message parts (wsdl:part child element of the wsdl:message element) to parameters and return values of Java methods.

This subsection describes the mapping for the wrapper style.

Organization of this subsection
(1) Mapping
(2) Conditions for the wrapper child element name
(3) Conditions for handling multiple wrapper child elements as the same wrapper child element
(4) Notes for coding multiple wrapper child elements
(5) Precautions for mapping to parameters
(6) Precautions for mapping to the return values

(1) Mapping

During mapping, the first letter of the wrapper child elements names of the WSDL is converted to lower-case letter in both, the request-response operations and one-way operations.

Before conversion: WrapperName

After conversion: wrapperName

(2) Conditions for the wrapper child element name

In the wrapper child element name, you can code a string that fulfills all the conditions described in the following table. However, when customizing with the binding declaration, you can code the strings that can be used as xsd:NCName type of the XML Schema specification.

Table 15-9 Conditions for strings that can be coded in the wrapper child element name (wrapper style)

No. Conditions Examples of invalid strings Operations when invalid strings are specified
1 Strings using only one-byte alphanumeric characters (0 to 9, A to Z, a to z) and underscore (_) Hitachi_wrapper The operation might not function properly (error message is not displayed).
2 Strings other than Java reserved words # abstract An error message is output in the standard error output and log and the processing ends (KDJW51018-E).
3 Strings that do not begin with numeric characters 1User_wrapper An error message is output in the standard error output and log and the processing ends.

#
You cannot code strings such as Abstract where the first character of the Java reserved word is in upper case (since the first character is converted into a lower case character due to mapping).

(3) Conditions for handling multiple wrapper child elements as the same wrapper child element

When the wrapper child element that appears in the input message or output message is coded several times in WSDL, handling of the wrapper child elements differs depending on whether the local name and the XML Schema type of wrapper child elements are same or different, as described in the following table:

Table 15-10 Different handling of wrapper child elements depending on local name and XML Schema type of wrapper child elements

No. Local name of wrapper child element XML Schema type of wrapper child element Handling of wrapper child element
1 When the local name is same When the XML Schema type is same Handled as the same wrapper child element, when each of the wrapper child elements indirectly reference to the same global element using the ref attribute of the xsd:element element.
2 When the XML Schema type is different Handled as separate wrapper child elements.
3 When the local name is different When the XML Schema type is the same Handled as separate wrapper child elements.
4 When the XML Schema type is different

(4) Notes for coding multiple wrapper child elements

When you define same wrapper child elements and different wrapper child elements multiple times in a WSDL file as the composite-type child elements, and execute the cjwsimport command by specifying this WSDL file, SEI will be mapped with the non-wrapper style.

The following is an example of the WSDL file where SEI is mapped with the non-wrapper style:

<wsdl:definitions name="TestJaxWsService"
                  xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/
                  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                  xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                  xmlns:tns="http://example.com/example"
                  targetNamespace="http://example.com/example">
 
   <xsd:element name="getUserData" type="tns:getUserData"/>
    ...
   <xsd:complexType name="getUserData">
     <xsd:sequence>
       <xsd:element name="in0"  type="xsd:string"/>
       <xsd:element name="in0"  type="xsd:string"/>
       <xsd:element name="hoge" type="xsd:string"/>
     </xsd:sequence>
   </xsd:complexType>
   ...
  </xsd:schema>
 </wsdl:types>
...
 <wsdl:message name="getUserDataRequest">
  <wsdl:part name="inputParameters" element="tns:getUserData"/>
 </wsdl:message>
 ...
</wsdl:definitions>
 

(5) Precautions for mapping to parameters

(6) Precautions for mapping to the return values

If there is 1 wrapper child element of out or if the local name of the wrapper child element of out is "return", that value is mapped to the return value of the method. However, even if the types are different, if you code multiple wrapper child elements with the local name "return", an error message is output in the standard error output and log and the processing ends.