I have posted same question on sun forum, but did not get the response from the users. Hence posting here...
Here is my Question.
I read many articles regarding Holder class in Java....but still does not getting what is the use of that. In one article I saw Order as a object which has properties OrderId, OrderDate. They put Holder class as OrderHolder.java
I read one sentense as Holder classes enable the mapping to preserve the intended WSDL signature and parameter-passing semantics.
I am not getting this sentense. How it (OrederHolder class) preserves the order in intended WSDL signature?
"Holder classes enable the mapping to preserve the intended WSDL signature and parameter-passing semantics."
Look just above:
Rajesh Sumra wrote:
OUT type: An OUT parameter is passed as copy without any input value to the Web service method. The Web service method fills the OUT parameter and returns it to the client.
INOUT type: An INOUT parameter is passed as copy with an input value to the Web service method. The Web service method uses the input value, processes it, fills the INOUT parameter with a new value, and returns it to the client.
In pure Java "result" will be "false" because "myNumber" still references "Integer(10)". However if "webMethod" was a web service operation then according to WSDL parameter rules "myNumber" should be referencing an "Integer(99)" instance (and "result" should be "true") as OUT or (modified) INOUT parameters are copied back (which never happens in pure Java).
So in Java this behavior is faked by using "Holder" objects.
Now in Java the "result" will be "true" - because it can copy back the value/reference assigned in the method.