• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Netbeans jax-ws generated sources erroring on method invocation.

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've used the netbeans 7.1 wizard to create a web application consume a web service. New > Java Web > Web Aplication, then New WebService Client... > Browse for web service, then New > Servlet.

When I try to create the entity class to do a create with in the web service all of the methods for the entity class error.



The same exact code (cut and pasted) in a similarly generated Java SE test application compiles and creates a record just fine. Am I missing something simple?

here is the entity POJO below. It has no zero arg constructor but the compiler should provide that. Neither does the SE version.




 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

When I try to create the entity class to do a create with in the web service all of the methods for the entity class error.


Can you elaborate this with errors you get?
 
Jeremy James Brown
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Line 23 bd2.setId("ID10008"); <= "package bd2 does not exist <identifier> expected illegal start of type"

If I move the setter calls into the processRequest method this problem goes away. This solution has allowed me to move forward with my development of the web service client, but I would still like to understand the cause of this error.
 
Vijitha Kumara
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What "of.createBankdata();" returns? And were you able to import the package "webservice.Bankdata" through the IDE (not manually by typing the entire thing)?
 
Jeremy James Brown
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vijitha Kumara wrote:What "of.createBankdata();" returns? And were you able to import the package "webservice.Bankdata" through the IDE (not manually by typing the entire thing)?



I think the issue here is calling any kind of method above the method declarations in the Servlet.



I think there is probably some lesson I really need to learn about Servlets in here somewhere. Because this makes no sense to me.
 
Vijitha Kumara
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh! I missed it, Yes you need to use them inside methods, it's no difference form any other regular Java class as far as using methods from objects.
 
Jeremy James Brown
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vijitha Kumara wrote:Oh! I missed it, Yes you need to use them inside methods, it's no difference form any other regular Java class as far as using methods from objects.



For readers who may be looking at this because they did the same silly thing I did. You can do any setup method calls in the servlet init() method.
reply
    Bookmark Topic Watch Topic
  • New Topic