Saturday, September 28, 2013

Alert hello world not working

Alert hello world not working

I have created a webservice to alert hello world using javacript. But no
results come. Even no error. I couldnot figure out where I do the mistake.
I just host the wsdl in locally. What have I missed?
Here is my code
<%@ Master Language="C#" AutoEventWireup="true"
CodeFile="Site.master.cs" Inherits="SiteMaster" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head runat="server">
<title></title>
<link href="~/css/style.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/NetWebsite/js/jquery-1.10.2.js"
></script>
<script type="text/javascript" src="/NetWebsite/js/script.js" ></script>
<script language="JavaScript">
var iCallID;
function InitializeService(){
service.useService(http://localhost:5431/WebSite1/WebService.asmx?WSDL,"HelloWorldService");
service.HelloWorldService.callService("HellowWorld");
}
function ShowResult(){
alert(event.result.value);
}
</script>
<link href="~/Styles/Site.css" rel="stylesheet" type="text/css" />
<asp:ContentPlaceHolder ID="HeadContent" runat="server">
</asp:ContentPlaceHolder>
</head>
<body onload="InitializeService()" id="service"
style="behavior:url(webservice.htc)" onresult="ShowResult()">
<form runat="server">
<div class="page">
<div class="main">
<asp:ContentPlaceHolder ID="MainContent" runat="server"/>
</div>
<div class="clear">
</div>
</div>
<div class="footer">
</div>
</form>
</body>
</html>

1 comment: