我创建了一个 web 服务来使用 javacript 来提醒你好世界。但是没有结果。甚至没有错误。我不知道我在哪里做错了。我只是在本地托管 wsdl。我错过了什么?
这是我的代码
<%@ 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>