• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java client doesn't throw exception if endpoint url is incorrect?

 
Dario Rehman
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am testing a Java Web Service client that is generated with Axis 1.3.
I noticed that if I change the outPort address (endpoint) to a URL that is incorrect, no exception is thrown, but when I look at the TCP traffic, obviously there is a "HTTP 404 Not Found" error.
Why is this happening? How can I check if the call was successful?

Thanks.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, are you still getting the correct response, or actually any response? Surely there must be some difference if you run the code?
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With a stub generated with WSDL2Java it throws an org.apache.axis.AxisFault.

 
sasank ch
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how about inserting code in your program something like this to know if there is an error

if (super.cachedEndpoint == null) {
throw new org.apache.axis.NoEndPointException();
}
 
Dario Rehman
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is how I have to invoke my WS (given the code that WSDL2Java generates). If the endpoint URL is incorrect or the authentication fails no exception is thrown with this code. Why is this happening?



Originally posted by Peer Reynders:
With a stub generated with WSDL2Java it throws an org.apache.axis.AxisFault.


[ November 21, 2007: Message edited by: Dario Rehman ]
 
Peer Reynders
Bartender
Posts: 2968
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why are you creating a new stub (with a null endpoint URL nonetheless) ? That is the locator's job.

I would expect the code to look something like this:

 
Dario Rehman
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right, he stub is misplaced. This is the code I am using.
The original problem remains, though...




Originally posted by Peer Reynders:
Why are you creating a new stub (with a null endpoint URL nonetheless) ? That is the locator's job.

I would expect the code to look something like this:

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic