NetBeans Forums
| View previous topic :: View next topic |
| Author |
Message |
Swiftslide
Joined: 08 Aug 2010 Posts: 11
|
Posted: Tue May 17, 2011 8:48 am Post subject: Use a custom class as a SOAP return type? |
|
|
I'm using NetBeans's Web Service generation tools. I've looked at the tutorials available, but cannot find anything on how to use a custom class as a return type. Most of the tutorials I've read are no more complex than Hello World: they take and return simple types like Strings.
So say I want a class that has 3 fields: a String, an int and a double[]. So far, the only way I can pass my own classes is by creating "envelope classes", with no methods, a parameter-less constructor, and with all fields declared public. I'd prefer to write standard java classes. Obviously I cannot send the methods across SOAP, but I would have thought there was a way to ignore the methods when Marshalling the class, and only Marshall the fields.
Somebody has told me there are Annotations that facilitate this, but I can't find any tutorials on how to implement them. Any guidance would be greatly appreciated  |
|
| Back to top |
|
 |
Jeffrey Rubinoff Posted via mailing list.
|
Posted: Fri May 20, 2011 12:48 am Post subject: Re: Use a custom class as a SOAP return type? |
|
|
Swiftslide,
I don't know if this is helpful, but have you looked at the Web Service
Passing Binary Data tutorial,
http://netbeans.org/kb/docs/websvc/flower_overview.html ? This shows how
to pass a java.awt.Image over SOAP. Perhaps your use case is analogous?
Jeff
On 5/17/2011 10:48 AM, Swiftslide wrote:
| Quote: | I'm using NetBeans's Web Service generation tools. I've looked at the tutorials available, but cannot find anything on how to use a custom class as a return type. Most of the tutorials I've read are no more complex than Hello World: they take and return simple types like Strings.
So say I want a class that has 3 fields: a String, an int and a double[]. So far, the only way I can pass my own classes is by creating "envelope classes", with no methods, a parameter-less constructor, and with all fields declared public. I'd prefer to write standard java classes. Obviously I cannot send the methods across SOAP, but I would have thought there was a way to ignore the methods when Marshalling the class, and only Marshall parameters.
Somebody has told me there are Annotations that facilitate this, but I can't find any tutorials on how to implement them. Any guidance would be greatly appreciated :)
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|