wood burning stoves 2.0*
The moose likes Web Services and the fly likes Webservice return type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Webservice return type" Watch "Webservice return type" New topic
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
    
    5
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
    
    5
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Webservice return type
 
Similar Threads
Axis2 wizard problems in eclipse
ClassCastException
weblogic soap client problem with vector of vectors
Return Complex Type (GlassFish v2 and .Net 3.5 client)
First time only SOAPException while invoking a web service