Testing a WebService

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chinedu

    #1

    Testing a WebService

    Please help guys,

    I wondering if there is a way to test a web service for availability. i.e a
    simple test to see if the webservice is up and running or available before I
    make the actual method call on the webservice...so mething like a ping in
    networking


    --
    Faith as small as a mustard seed can move mountains...Jes us Christ
  • John Scragg

    #2
    RE: Testing a WebService

    Call a method and catch/test the System.Net.WebE xception. This being the
    case, it does not make sense to perform this task twice, just be sure you
    make all of your webmethod calls in a try/catch block.

    Calling a webmethod to test for an error only to turn around and call it (or
    another method) again to get results does not make sense.

    You can pink the server (if it responds to pings) to see if the server is
    up, but you are going to have to rely on status codes (errors) to see if the
    actual web service is responding.

    HTH,

    John Scragg

    "Chinedu" wrote:
    [color=blue]
    > Please help guys,
    >
    > I wondering if there is a way to test a web service for availability. i.e a
    > simple test to see if the webservice is up and running or available before I
    > make the actual method call on the webservice...so mething like a ping in
    > networking
    >
    >
    > --
    > Faith as small as a mustard seed can move mountains...Jes us Christ[/color]

    Comment

    • Marvin Smit

      #3
      Re: Testing a WebService

      Hi,

      what you could do is make a simple HttpRequest to the 'index page' of
      the webservice. Catch the HTTP timeout or error code returned. This
      will tell you if it's "up & running". There is ofcourse still a race
      condition if anything happens to the server between you check and the
      first WebService call... but you would know up front if its down.

      Hope this helps,

      Marvin Smit.


      On Mon, 24 Oct 2005 09:29:04 -0700, "Chinedu"
      <Chinedu@discus sions.microsoft .com> wrote:
      [color=blue]
      >Please help guys,
      >
      >I wondering if there is a way to test a web service for availability. i.e a
      >simple test to see if the webservice is up and running or available before I
      >make the actual method call on the webservice...so mething like a ping in
      >networking[/color]

      Comment

      • Muthukumar G.

        #4
        RE: Testing a WebService

        you can type the URL of the webservice in IE

        http://<yourserver>/webapp/webservice.asmx ?wsdl (this will give you xml
        display - which says your webservice is active )

        http://<yourserver>/webapp/webservice.asmx (this will give you web based
        form to invoke and check your webserives..)



        "Chinedu" wrote:
        [color=blue]
        > Please help guys,
        >
        > I wondering if there is a way to test a web service for availability. i.e a
        > simple test to see if the webservice is up and running or available before I
        > make the actual method call on the webservice...so mething like a ping in
        > networking
        >
        >
        > --
        > Faith as small as a mustard seed can move mountains...Jes us Christ[/color]

        Comment

        Working...