uCosminexus Application Server, Web Service Development Guide
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.
Figure 15-4 Example of mapping message parts to parameters and return values (request-response operation)
Figure 15-5 Example of mapping of message parts and parameters (one-way operations)
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
Table 15-8 Mapping of part types to Java sources (Wrapper style)
| No. | WSDL part types | Mapping to Java | |
|---|---|---|---|
| Mapped to | Mapping method | ||
| 1 | in | Parameter | Not mapped using javax.xml.ws.Holder<T> class. Mapped using classes such as java.lang.String. |
| 2 | inout | Parameter | Mapped using javax.xml.ws.Holder<T> class. # |
| 3 | out | Parameter | Mapped using javax.xml.ws.Holder<T> class. # |
| 4 | Return value | Not mapped using javax.xml.ws.Holder<T> class. Mapped using classes such as java.lang.String. | |
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. |
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 |
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>
|
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.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.