• 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

how can I get the status of webservice

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am writing a utility for our project where I provide a page where the status of all the resources used in the application and the webseri
vices the application access are provided.

For Datasources I am running a dummy querry to test the status.

For webserivices I am trying to conenct to the webservce URL and if I get a response code of 200 I am saying status is OK.

--------------------------------------------------------------------
final URL url = new java.net.URL( endPointURL );
final URLConnection uconn = url.openConnection( );
final java.net.HttpURLConnection conn = (java.net.HttpURLConnection)uconn;
conn.connect( );
responseCode = conn.getResponseCode( );
--------------------------------------------------------------------

Can you suggest of any other test that I can do. These are external webserivices that my application calls.

Regards
Mou
 
mou haj
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One more thing is when I call these webservices from browser ie type the webservice URL in browser I get a response

Hi there, this is a Web service!

Is there any way of getting this test back in my java program?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Is there any way of getting this test back in my java program?



Sure - look into use of java.net.HttpURLConnection.

Bill
 
reply
    Bookmark Topic Watch Topic
  • New Topic