uCosminexus Application Server, Web Service Development Guide

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

16.1.6 Mapping the parameter and return value to the message part (For non-wrapper style)

This subsection describes the mapping of the parameters of the method of SEI to WSDL (name attribute of the wsdl:part element).

This subsection describes the mapping for the non-wrapper style.

Organization of this subsection
(1) Mapping
(2) Java types that can be specified in the parameters
(3) Conditions for the parameter names
(4) Combinations of parameters and return values
(5) Relationship between the specification of the annotation and the mapping to the part name
(6) Operations during name conflict
(7) Using the java.util.Map class

(1) Mapping

For the non-wrapper style, the method parameters of SEI are mapped to the WSDL part and global elements using the same name as the operation name. The return value is mapped to the WSDL part and global element using the name with "Response" suffixed to the operation name. The non-wrapper style does not require the request and response beans. Therefore, the apt and cjwsgen commands do not automatically generate the request and response beans. However, you can check for errors beforehand by executing the cjwsgen command for the compiled Web resource Implementation Class. For details, see 10.23(1) Using the cjwsgen command for checking errors.

The following figure shows an example of mapping:

Figure 16-7 Example of mapping the method parameters and return values to the message parts (Non-wrapper style)

[Figure]

(2) Java types that can be specified in the parameters

The Java types that can be specified in the parameters are the same as for the wrapper type. For details, see 16.1.5(2) Java types that can be specified in the parameters.

(3) Conditions for the parameter names

The parameter names of the Java methods are not mapped to WSDL; therefore, code the Java method parameters in accordance with the Java identifier naming rules provided in the Java language specifications.

(4) Combinations of parameters and return values

You can specify any number of method parameters that are SOAP Header. However, as far as the method parameters that are the SOAP Body are concerned, the specifiability and the specified number are determined by the relationship with the return value. The following table describes the conditions for the return values of the methods and the specification method of the parameters:

Table 16-6 Conditions for the return values of the methods and the specification method of the parameters

No. Conditions for the return values Specification method of the parameters
Presence of return values Specified location
1 No --
  • You can specify either one in parameter or one inout parameter. #1
  • You can specify either one out parameter or one inout parameter. #2
2 Yes SOAP header
  • You can specify either one in parameter or one inout parameter. #1
  • You can specify either one out parameter or one inout parameter. #2
3 Yes SOAP body
  • You can specify one in parameter. #1
  • You cannot specify the out parameter and inout parameter. #3

#1
If 0 or 2 or more are specified in total, an error message is output to the standard error output and logs (KDJW61056-E).

#2
If 0 or 2 or more are specified in total, an error message is output to the standard error output and logs (KDJW61057-E).

#3
If the out parameter or inout parameter is specified, an error message is output to the standard error output and logs (KDJW61059-E).

If the out parameter or inout parameter is used in the non-wrapper style, you must specify the name element of the javax.jws.WebParam annotation. If the name element of the javax.jws.WebParam annotation is not specified, an error message is output to the standard error output and logs (KDJW61085-E).

(5) Relationship between the specification of the annotation and the mapping to the part name

The mapping of the method parameter to the WSDL part (name attribute of the wsdl:part element) depends on the element values of the javax.jws.WebParam annotation and javax.jws.WebMethod annotation.

The following table describes the relationship between the specification of the annotation and the mapping methods:

Table 16-7 Relationship between the specification of annotations and the mapping to the WSDL part name

No. Specification of annotation elements Method of mapping to the WSDL part name
javax.jws.WebParam
@partName
javax.jws.WebParam
@name
javax.jws.WebMethod
@operationName
1 Specified -- -- The element value of the specified annotation is mapped to the name attribute of the wsdl:part element.
2 Not specified Specified --
3 Not specified Specified The Java method name is mapped to the name attribute of the wsdl:part element.
4 Not specified

Legend:
--: Indicates that the presence or absence of specification for the element does not affect the mapping (the mapping method is the same whether the element is specified or not).

(6) Operations during name conflict

This point describes the operations for a name conflict of the part names and global elements.

(7) Using the java.util.Map class

For details about using the java.util.Map class, see 16.1.5(6) Using the java.util.Map class.