NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Use a custom class as a SOAP return type?

 
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users
View previous topic :: View next topic  
Author Message
Swiftslide



Joined: 08 Aug 2010
Posts: 11

PostPosted: Tue May 17, 2011 8:48 am    Post subject: Use a custom class as a SOAP return type? Reply with 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 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 Smile
Back to top
Jeffrey Rubinoff
Posted via mailing list.





PostPosted: Fri May 20, 2011 12:48 am    Post subject: Re: Use a custom class as a SOAP return type? Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> Java EE Users All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB
By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo