4

I am trying to call the webservice to get a simple list of tasks, from a windows 7 gadget.

Now, basically its a html page, with Javascript if need be. Ive looked at Simplest SOAP example, but had no luck. (My button doesnt do anything)

There is a button on my html page. The procedure would be.

  1. Click the button.

  2. Sends request to web service.

  3. Recieve response from webservice

  4. display the response below the button.

Any example code, as complete as possible would be much appreciated. Or at worst, some detailed instructions following my 4 steps, and how I achieve it.

Ive never fully understood javascript, but think I did it correctly. (Note, it works fine connecting via the URL, to the REST service).

<html>
   <head> 
     <script type="text/javascript" src="jquery-1.6.4.min.js"></script>

     <script>
      function getTasks() {
        $.get("https://localhost/TEST.TestService.svc/rest/Services?CostCentreNo=1&Filter=0",
          function(data){
            alert("Data Loaded: " + data);
          });
    }
    </script>
   </head>
   <body>
      <button onclick="javascript:getTasks();">Show Match</button>
   </body>
</html>
Community
  • 1
  • 1
IAmGroot
  • 13,760
  • 18
  • 84
  • 154
  • What you're doing looks roughly like it should work. Use Firebug or Chrome's inspector to look for any javascript exceptions (console) and inspect network activity to see if request is made. – Nik Nov 02 '11 at 14:56

1 Answers1

2

did you read this How do i get access to SOAP response property? and the answer, if you get stuck i might abeable to help

for REST JavaScript REST client Library

Community
  • 1
  • 1
david
  • 4,218
  • 3
  • 23
  • 25
  • I am using fiddler2 to inspect any calls made, but there is no request, so the response is the least of my problems. :( . I have seen the REST link. But again, I don't fully understand how to trigger the call using the given code. Suggestions? :) – IAmGroot Nov 02 '11 at 15:18
  • i dont use jquery, ill see if i can whip up some thing, it wont be jquery – david Nov 02 '11 at 15:52
  • It doesnt matter what it is, as long as it works :). Thanks for your help. – IAmGroot Nov 02 '11 at 16:15
  • just follow one of my answers and you should be able to get the responce back form your request http://stackoverflow.com/questions/7762665/ajax-php-not-providing-me-with-any-response-text/7762701#7762701 – david Nov 02 '11 at 16:36