I have two very similar wsdl files that generate different Java codes. In the first case, I get a method with the annotation @WebMethod and the return value, in the second case, a method is generated with the annotation @ResponseWrapper and without return values. I would like to have return values.
1. Service1
<wsdl:operation name="foo"> <wsdl:input name="deleteUser" message="tns:deleteUserRequest"/> <wsdl:output name="deleteUserResponse" message="tns:deleteUserResponse"/> <wsdl:fault name="ServiceFault" message="tns:ServiceFault"/> </wsdl:operation>
generates:
@WebMethod @WebResult(name = "commonReturnType", targetNamespace = "http://www.foo.com/fooSchemaTypes-v3.0/", partName = "returnValue") public CommonReturnType foo( @WebParam(name = "fooType", targetNamespace = "http://www.foo.com/fooSchemaTypes-v3.0/", partName = "user") FooType user) throws ServiceFault ;
2. FooBarService
<wsdl:operation name="fooBar"> <wsdl:input name="fooBar" message="tns:fooBarRequest"></wsdl:input> <wsdl:output name="ackFileResponse" message="tns:fooBarResponse"></wsdl:output> <wsdl:fault name="ServiceFault" message="tns:fooBarFault"></wsdl:fault> </wsdl:operation>
genereates:
@WebMethod @RequestWrapper(localName = "fooBar", targetNamespace = "http://www.foo.com/fooBarSchemaTypes-v1.0/", className = "com.foo.fooBar.v1_0.GetFileType") @ResponseWrapper(localName = "fooBarResponse", targetNamespace = "http://www.foo.com/fooBarSchemaTypes-v1.0/", className = "com.foo.fooBar.v1_0.CommonReturnType") public void ackFile( @WebParam(name = "id", targetNamespace = "") String id, @WebParam(name = "timestamp", targetNamespace = "") XMLGregorianCalendar timestamp, @WebParam(name = "anotherId", targetNamespace = "") String anotherId, @WebParam(name = "fileId", targetNamespace = "") String fileId, @WebParam(name = "returnCode", targetNamespace = "", mode = WebParam.Mode.OUT) Holder<ReturnCode> returnCode, @WebParam(name = "errorMessage", targetNamespace = "", mode = WebParam.Mode.OUT) Holder<String> errorMessage);
The code that generates the code is exactly the same.
If necessary, I can provide markup for messages and types. I hope the anonymity has not ruined the relevant parts.
I would like the second version also to have a return value. How can I achieve this?