Web Service with Java generic type

manant74's picture
Hi, in my application i want expose my spring bean's as a Web Service. i have a problem with java generic type. Sample: //generic Inteface of my class //the method execute receive a Request object public interface IService { //the method execute receive a Request object public void execute(Request request); } public class Request { private Input parameter; public void setParameter(Input parameter) { this.parameter = parameter; } public Input getParameter() { return parameter; } } The implementation of IService specify the correct type of the fiels parameter: public class HelloWorldService implements IService { public void execute(Request request) { // implementation // } } The wsdl generated have'nt references to the HelloInput class In the wsdl the field paramater is declared as anyType How is possible to obtain a wsdl with the correct type HelloInput? You can help me? thank you Antonello
sanjayak's picture

This article should explain

This article should explain you what's happening internally. http://wso2.org/library/2801
manant74's picture

More info

Maybe my explanation is not clear. in my application i want expose my spring bean's (whith java generic type) as a Web Service. Sample: //generic Inteface of my class //the method execute receive a Request object public interface IService<Input> { //the method execute receive a Request object public void execute(Request<Input> request); } public class Request<Input> { private Input parameter; public void setParameter(Input parameter) { this.parameter = parameter; } public Input getParameter() { return parameter; } } The implementation of IService specify the correct type of the fiels parameter: public class HelloWorldService implements IService<HelloInput> { public void execute(Request<HelloInput> request) { // implementation // } } The wsdl generated have'nt references to the HelloInput class In the wsdl the field paramater is declared as anyType How is possible to obtain a wsdl with the correct type HelloInput? You can help me?
library project main code
Learn Cloud
Learn
Cloud

The WSO2 Application Server is a reliable application server that can host your enterprise web applications. The WSO2 Application Server as a Service is offered in StratosLive, the WSO2 Platform as a Service. This article explains how a simple web application can be developed and deployed from Carbon Studio to the WSO2 Application Server...

Latest Webinar
Different groups within an organization need to monitor different Key Performance Indicators (KPIs) - An operations team will be interested in the response times of business services and loads of each service,..
Thursday, February 9th 2012, 09.00 AM (PST)

Thursday, February 9th 2012, 10.00 AM (GMT)