You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Amila Suriarachchi <am...@gmail.com> on 2006/09/27 16:48:43 UTC

Codegen problem with unwrapping mode

In the unwrapped mode the Stub file generated has the following syntax.

public Response getMethod1(param1, param2){

       SOAPEnvelope env = null;

      env =
toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),

                                     param1,

                                     param2,

                                     optimizeContent(new
javax.xml.namespace.QName("",

                                    "Method1")));
}

public SOAPEnvelope toEnvelope(SoapFactory factory,

                                                         param1,

                                                         param2,

                                                         boolean){

                                     // wrap the parameters and return
envelope

                                    WrappedType wrappedType = new
WrappedType();

}


 In this way the method signature of the 'toEnvelope' method, depends on the
types of the inner parameters of the wrapped class. So if for to different
wrappedTypes, which has the same inner parameters (eg. if both have a only a
string inside), the method singature of the toEnvelope is identical. Hence
it gives a compile error and this method does not work for above senario. So
the only option (for me) is to produce the wrapped type inside the operation
method and pass the wrapped type to toEnvelope method.

Does this produce any side effects or can someone suggest another solution?

Amila.

Re: Codegen problem with unwrapping mode

Posted by Amila Suriarachchi <am...@gmail.com>.
Actually we can't set it to null (then calling method can't identify the
method to call).  But we can set it to something like
new  WrappedType() at the calling method.

In message receiver also we have

ReturnType paramx = null;

WrappedType wrappedParam = formOM(...);

InterType1 param1 = getMethod1(wrappedParam);
InterType2 param2 = getMethod2(wrappedParam);

paramx = skel.getMethod(param1,param2);

Here param1 and param2 always param1, param2 since it is the position in the
loop for loop.
So if paramx is equal to either the param1 or param2 then also we get a
compilation problem.

Shall we remove the param1, param2 terms as follows

paramx = skel.getMethod(getMethod1(wrappedParam), getMethod2(wrappedParam));

amila.

Re: Codegen problem with unwrapping mode

Posted by Davanum Srinivas <da...@gmail.com>.
Amila,

Could we add the wrapped type in the signature, but set that to null
all the time. that way the sig is unique.

-- dims

On 9/27/06, Amila Suriarachchi <am...@gmail.com> wrote:
>
>
> In the unwrapped mode the Stub file generated has the following syntax.
>
> public Response getMethod1(param1, param2){
>
>
>
>       SOAPEnvelope env = null;
>
>       env =
> toEnvelope(getFactory(_operationClient.getOptions().getSoapVersionURI()),
>
>                                      param1,
>
>                                      param2,
>
>                                      optimizeContent(new
> javax.xml.namespace.QName("",
>
>                                     "Method1")));}
>
> public SOAPEnvelope toEnvelope(SoapFactory factory,
>
>
> param1,
>
>
> param2,
>
>
> boolean){
>
>                                       // wrap the
> parameters and return envelope
>
>                                     WrappedType wrappedType
> = new WrappedType();
>
>  }
>
>
>
>
> In this way the method signature of the 'toEnvelope' method, depends on the
> types of the inner parameters of the wrapped class. So if for to different
> wrappedTypes, which has the same inner parameters (eg. if both have a only a
> string inside), the method singature of the toEnvelope is identical. Hence
> it gives a compile error and this method does not work for above senario. So
> the only option (for me) is to produce the wrapped type inside the operation
> method and pass the wrapped type to toEnvelope method.
>
> Does this produce any side effects or can someone suggest another solution?
>
> Amila.


-- 
Davanum Srinivas : http://www.wso2.net (Oxygen for Web Service Developers)

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org