aspose file tools*
The moose likes Web Services and the fly likes Netbeans jax-ws generated sources erroring on method invocation. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Netbeans jax-ws generated sources erroring on method invocation." Watch "Netbeans jax-ws generated sources erroring on method invocation." New topic
Author

Netbeans jax-ws generated sources erroring on method invocation.

Jeremy James Brown
Greenhorn

Joined: Mar 24, 2011
Posts: 27
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.




Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3855

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?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Jeremy James Brown
Greenhorn

Joined: Mar 24, 2011
Posts: 27
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

Joined: Mar 24, 2008
Posts: 3855

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

Joined: Mar 24, 2011
Posts: 27
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

Joined: Mar 24, 2008
Posts: 3855

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

Joined: Mar 24, 2011
Posts: 27
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Netbeans jax-ws generated sources erroring on method invocation.