| Author |
Webservice return type
|
Ajay Chawla
Greenhorn
Joined: Jan 14, 2004
Posts: 11
|
|
Hi, I've a web service deployed on weblogic7. This service returns a custom object which has a property of type Vector. This is working fine when i check it with the client auto-generated by weblogic. The problem comes when i try to access it with the client that I've created. On checking with the obj.getClass().getName(), i get java.lang.Object. I do not get the Vector which i need. Iam new to web services, so need input from you people.. Ajay
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
|
How did you create your own client?
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
Ajay Chawla
Greenhorn
Joined: Jan 14, 2004
Posts: 11
|
|
I created my own client using the clientgen utility, and using webserviceclient.jar. The build.xml was-- <project name="ClientSoccer" default="generate-client"> <target name="generate-client"> <taskdef name="clientgen" classname="weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask"/> <clientgen wsdl="http://localhost:7001/ws_clubsoccer/SoccerService?wsdl" packageName="soccer.client" clientJar="E:/soccer_client.jar" /> </target> </project> Running this build.xml gave me the soccer_client.jar, which I used to compile the java files at my client end.
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
I guess the problem is that because Vector isn't one of the built-in supported data types, the clientgen task generates some kind of a generic serialization class for it, causing you to see only a java.lang.Object. Looking at http://edocs.bea.com/wls/docs70/webserv/anttasks.html#1080160, you should try using the useServerTypes="true" and ear="../foo/bar.ear" attributes.
|
 |
Ajay Chawla
Greenhorn
Joined: Jan 14, 2004
Posts: 11
|
|
Yeh I too think thats the reason. Thanks Lasse
|
 |
 |
|
|
subject: Webservice return type
|
|
|