Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Calling a webservice in html using webservice.htc?

$
0
0

Hi,

I am testing a webservice and consuming it in html. The webservice is working fine, but when I use it in html, I get an error that the "service object doesn't support the method 'useService'". Please help me in solving this. I have the webservice.htc file from Microsoft in the html file folder. Thanks.

<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head><title>UseSwap</title><script lang="JavaScript">
        function InitializeService(){
            service.useService( "http://localhost:51559/WebService.asmx?WSDL" , "Feedback" );
        }
        var a1, a2, a3, a4, a5, a6;
        function Insert(){
            a1 = document.myForm.q1.value;
            a2 = document.myForm.q2.value;
            a3 = document.myForm.q3.value;
            service.Feedback.callService("insert", a1, a2, a3);
        }
        function ShowResult(){
            alert(event.result.value);
        }</script></head><body onload="InitializeService()" id="service" style="behavior:url(webservice.htc)" ><form name="myForm">
       a1 : <input type="text" name="q1"/>
       a2 : <input type="text" name="q2"/>
       a3 : <input type="text" name="q3"/><button onclick="Insert()">Submit</button></form></body></html>


Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>