aspose file tools*
The moose likes Web Services and the fly likes return type Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "return type" Watch "return type" New topic
Author

return type

Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Hi,
When I invoke my webservice method,It will return a set of data(encoded in XML),
for example
public String getPersonsData() {}

At this moment, the return type is string. On the client side, I convert this result string to xml.This works fine with java and .net.
Now my question is this a right way to return a xml data? Or is there is any elegant way to return a xml data so that both java and .net can consume it?
Please advice.



At this moment


Spritle Software Blogs
Manas Ahlaad
Ranch Hand

Joined: Nov 07, 2001
Posts: 165
general practice would be returning platform specific instances(of classes) so that they will be interpreted using reflection.
on java platform ideal method of return would be
Person[] - person array
Manas
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Manas Ahlaad:
general practice would be returning platform specific instances(of classes) so that they will be interpreted using reflection.
on java platform ideal method of return would be
Person[] - person array
Manas

thanks for the reply, actaully thats the one I'm using now, and its giving some interoperability error during axis jar versions , VS.NET versions ..blah blah..
still trying to consume them.
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Originally posted by Manas Ahlaad:

on java platform ideal method of return would be
Person[] - person array
Manas

Just wondering have you ever able to deploy & consume a webservice in ApacheAxis which returns a Person[] with style="document" or "rpc" ??
I'm trying this but not able to successfully consume it.
Getting the error
---
Error: Error while calling web service. Exception has been thrown by the target of an invocation.
Inner Exception: java.lang.NullPointerException
---
No idea where is the problem is ?
Could be nice if you could help me!..
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Yes!.. Just got it working after so much hurdle!(2 days)
But now I'm
BYW I used rpc style for this.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: return type
 
Similar Threads
How to create XML file in Java
annotations on entity class with spring oxm and jaxb for ArrayList
useBean doubt
Interceptor messes up action class in Struts2
Bean setters not invoked when no data entered in form fields