I have a requirement to return List of custom class(FeedMetaData) objects
from a web service method. When I invoke this method from client, I am
getting ClassCast Exception.
FeedMetaData is simple bean class with 3 fields of type String.
Below is the client code:
Bus bus = new CXFBusFactory().createBus();
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(bus);
Client client =
dcf.createClient("http://64.68.163.33:8080/socialkast-web/skservice/skservice?wsdl");
Object[] results = client.invoke("getCommecialFeeds");
List<FeedMetaData> result = (List<FeedMetaData>)results[0];
I get ClassCastException at above line.
Then I looked into the issue https://issues.apache.org/jira/browse/CXF-2415
and changed my return type to List<String> but still getting the same
Exception.
java.lang.ClassCastException: tv.socialkast.ws.ArrayOfString cannot be cast
to java.util.List
Below is the client code to
Bus bus = new CXFBusFactory().createBus();
JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance(bus);
Client client =
dcf.createClient("http://64.68.163.33:8080/socialkast-web/skservice/skservice?wsdl");
Object[] results = client.invoke("getCommecialFeeds");
List<String> result = (List<String>)results[0];
Although when I invoke the web service method in jira CXF-2415, I could
successfully get the list of strings. It clearly indicates we have some
problem with our web service.
2 Questions:
1. What do I need to change in my web service configurations so I can return
List.
2. Is it possible to return list of objects of custom class ?
I appreciate any help on this.
Is it possible to return list of objects of custom class
--
View this message in context:
http://cxf.547215.n5.nabble.com/Web-service-return-type-List-T-doesn-t-work-tp3342349p3342349.html
Sent from the cxf-user mailing list archive at Nabble.com.