• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cannot find a function in the generated Web Service stub

 
Manoj Paul
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,

I am developing an application which calls a web service from "http://jupiter.webspiders.com/event2mobile/services/entityservice.asmx?WSDL".

The genereted stub(EntityService_Stub.java) is:




The main problem in this generated stub is that the method GetAllEntity()
gives an error. It says "Cannot find symbol method ArrayOfEntity_fromObject((Object[])((Object[]) resultObj)[0])". And there is no method named ArrayOfEntity_fromObject() in the generated stub.

Can someone please throw some lights over this. Please Help!!

warm regards,
Manoj Raj Paul
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I just tried to generate a JAX-WS web service client using the WSDL for which you provided a link and it works like a charm.
I used NetBeans 6.7 beta running under Java 6.
Note that I generated a JAX-WS web service client, while you have generated a JAX-RPC client. Perhaps this is the cause of the problems you are having.
Best wishes!
 
Manoj Paul
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Thanks for the reply.
Actually I am using Java ME midlet. My application will be installed in a mobile device. When I am running it in a web browser(not using the Java ME (Midlet) technology), its absolutely working fine. Can you explain?

Warm regards,
Manoj Raj Paul
 
Manoj Paul
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Ivan Krizsan,
I used the same environment that you used like NetBeans 6.7. The error that i mentioned above has gone. There's no more compile time error anymore. But whiling running the program it gives an exception saying "java.lang.ClassCastException
" in the line .

Can you tell me why its happening?

Thanks & regards,

Manoj Paul
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
First, I have no experience with Java ME, so I cannot help you there.
Second, why do you cast the result of getSingleEntity to Entity? This is not necessary and lead me to believe that you have imported the wrong Entity.
The code should read:

I just tried it here and it works without problems.
Best regards!
 
Manoj Paul
Ranch Hand
Posts: 112
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
Thank you Ivan for the help.

Regards!!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic