Kohsuke Kawaguchi wrote:
>
> I'm investigating one of the failures and I think I found a bug in
> wscompile.
>
> in the async/wsdl_hello_lit/client test, it generates the attached
> Hello interface.
>
> In particular compare these three:
>
> public Response<Hello1WorldResponse> hello1WorldAsync(
> HelloType req, HelloType inHeader);
>
> public Future<?> hello1WorldAsync(
> HelloType req, HelloType inHeader,
> AsyncHandler<Hello1WorldResponse> asyncHandler);
>
> public void hello1World(
> HelloType req,
> HelloType inHeader,
> Holder<HelloOutput> res,
> Holder<HelloType> outHeader);
>
> The spec says in section 2.3.4.2 that:
>
> A callback method takes an additional final parameter that is an
> instance of a typed
> AsyncHandler<ResponseBean> and returns a wildcard Future<?> that may
> be polled to
>
> So I've been assuming that given the sync version
>
> Tr foo( T1 param1, T2 param2, ... Tn paramn );
>
> the async version is always:
>
> Response<Tr> fooAsync( T1 param1, T2 param2, ... Tn paramn );
>
> Future<?> fooAsync( T1 param1, T2 param2, ... Tn paramn,
> AsyncHandler<Tr> asyncHandler );
>
> ... which seems to be what the word "additional" is implying. OTOH, it
> does say "response bean".
>
> Is this the correct signature to generate? If so, I need to do some
> surgery on client SEIStub.
>
Yes, the generated signature looks correct. The response parameters
(headers and body) appear as property in the response bean.
-vievk.
> ------------------------------------------------------------------------
>
>
> package async.wsdl_hello_lit.client;
>
> import java.util.concurrent.Future;
> import javax.jws.WebMethod;
> import javax.jws.WebParam;
> import javax.jws.WebParam.Mode;
> import javax.jws.WebResult;
> import javax.jws.WebService;
> import javax.jws.soap.SOAPBinding;
> import javax.jws.soap.SOAPBinding.ParameterStyle;
> import javax.xml.ws.AsyncHandler;
> import javax.xml.ws.Holder;
> import javax.xml.ws.Response;
>
>
> /**
> * This class was generated by the JAXWS SI.
> * JAX-WS RI 2.0.1-02/13/2006 03:02 PM(kohsuke)-ea
> * Generated source version: 2.0
> *
> */
> @WebService(name = "Hello", targetNamespace = "urn:test", wsdlLocation = "C:\\kohsuke\\Sun\\jax-ws\\test-rearch\\test\\build\\temp\\WEB-INF\\wsdl\\hello_literal.wsdl")
> @SOAPBinding(parameterStyle = ParameterStyle.BARE)
> public interface Hello {
>
>
> /**
> *
> * @param parameters
> * @return
> * returns javax.xml.ws.Response<async.wsdl_hello_lit.client.HelloOutput>
> */
> @WebMethod(operationName = "hello", action = "urn:test:hello")
> public Response<HelloOutput> helloAsync(
> @WebParam(name = "Hello", targetNamespace = "urn:test:types", partName = "parameters")
> Hello_Type parameters);
>
> /**
> *
> * @param parameters
> * @param asyncHandler
> * @return
> * returns java.util.concurrent.Future<? extends java.lang.Object>
> */
> @WebMethod(operationName = "hello", action = "urn:test:hello")
> public Future<?> helloAsync(
> @WebParam(name = "Hello", targetNamespace = "urn:test:types", partName = "parameters")
> Hello_Type parameters,
> @WebParam(name = "helloResponse", targetNamespace = "", partName = "asyncHandler")
> AsyncHandler<HelloOutput> asyncHandler);
>
> /**
> *
> * @param parameters
> * @return
> * returns async.wsdl_hello_lit.client.HelloOutput
> */
> @WebMethod(action = "urn:test:hello")
> @WebResult(name = "HelloOutput", targetNamespace = "urn:test:types", partName = "parameters")
> public HelloOutput hello(
> @WebParam(name = "Hello", targetNamespace = "urn:test:types", partName = "parameters")
> Hello_Type parameters);
>
> /**
> *
> * @param inHeader
> * @param req
> * @return
> * returns javax.xml.ws.Response<async.wsdl_hello_lit.client.Hello1WorldResponse>
> */
> @WebMethod(operationName = "hello1", action = "urn:test:hello")
> public Response<Hello1WorldResponse> hello1WorldAsync(
> @WebParam(name = "Hello1", targetNamespace = "urn:test:types", partName = "req")
> HelloType req,
> @WebParam(name = "Header", targetNamespace = "urn:test:types", header = true, partName = "inHeader")
> HelloType inHeader);
>
> /**
> *
> * @param inHeader
> * @param asyncHandler
> * @param req
> * @return
> * returns java.util.concurrent.Future<? extends java.lang.Object>
> */
> @WebMethod(operationName = "hello1", action = "urn:test:hello")
> public Future<?> hello1WorldAsync(
> @WebParam(name = "Hello1", targetNamespace = "urn:test:types", partName = "req")
> HelloType req,
> @WebParam(name = "Header", targetNamespace = "urn:test:types", header = true, partName = "inHeader")
> HelloType inHeader,
> @WebParam(name = "hello1WorldResponse", targetNamespace = "", partName = "asyncHandler")
> AsyncHandler<Hello1WorldResponse> asyncHandler);
>
> /**
> *
> * @param outHeader
> * @param inHeader
> * @param req
> * @param res
> */
> @WebMethod(operationName = "hello1", action = "urn:test:hello")
> public void hello1World(
> @WebParam(name = "Hello1", targetNamespace = "urn:test:types", partName = "req")
> HelloType req,
> @WebParam(name = "Header", targetNamespace = "urn:test:types", header = true, partName = "inHeader")
> HelloType inHeader,
> @WebParam(name = "HelloOutput", targetNamespace = "urn:test:types", mode = Mode.OUT, partName = "res")
> Holder<HelloOutput> res,
> @WebParam(name = "Header", targetNamespace = "urn:test:types", header = true, mode = Mode.OUT, partName = "outHeader")
> Holder<HelloType> outHeader);
>
> /**
> *
> * @param paramIn
> * @return
> * returns javax.xml.ws.Response<java.lang.Integer>
> */
> @WebMethod(operationName = "hello0", action = "urn:test:hello0")
> public Response<Integer> hello0Async(
> @WebParam(name = "Hello_in0", targetNamespace = "urn:test:types", partName = "param_in")
> int paramIn);
>
> /**
> *
> * @param paramIn
> * @param asyncHandler
> * @return
> * returns java.util.concurrent.Future<? extends java.lang.Object>
> */
> @WebMethod(operationName = "hello0", action = "urn:test:hello0")
> public Future<?> hello0Async(
> @WebParam(name = "Hello_in0", targetNamespace = "urn:test:types", partName = "param_in")
> int paramIn,
> @WebParam(name = "hello0Response", targetNamespace = "", partName = "asyncHandler")
> AsyncHandler<Integer> asyncHandler);
>
> /**
> *
> * @param paramIn
> * @return
> * returns int
> */
> @WebMethod(action = "urn:test:hello0")
> @WebResult(name = "Hello_out0", targetNamespace = "urn:test:types", partName = "param_out")
> public int hello0(
> @WebParam(name = "Hello_in0", targetNamespace = "urn:test:types", partName = "param_in")
> int paramIn);
>
> }
>
--
Vivek Pandey
Web Services Standards and Technologies
Sun Microsystems Inc.