Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Newbie: Returning objects via JAX-RPC?  RSS feed

 
Tina Coleman
Ranch Hand
Posts: 150
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Traversing through the web tutorial, I see that I'm supposed to be able to return user objects from my web services. My attempts to do so, though, keep resulting in NoSuchMethodErrors. Methods on my service that return Strings have no such problems.
Here's my understanding of the rules for value objects:
* must be serializable
* must have a public, no arg constructor
* must have getters/setters for private data
The generated WSDL file does reference the methods that return TestData objects, so I believe I've set up the jaxrpc-ri.xml file appropriately for wscompile to generate the ties.
Any guidance/ideas? All of the Jax-rpc examples in the tutorial just return a String, so I haven't seen a working example to figure out what's probably a stupid mistake on my part.


 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It may have to do with the names on your variables and the get/set naming convention. Instead of _num try naming the variable num.

As I recall, the convention is that the get and set method names are created by uppercasing the first letter of the variable but yours start with _
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!