web services and ajax

  • Thread starter Thread starter barry
  • Start date Start date
B

barry

I have created a web service on my local machine and left if alone
(HelloWorld) (vb.net)
Below is the code for the declarative portion:

<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
<Services>
<asp:ServiceReference Path="WebService.asmx"
/>
</Services>
</asp:ScriptManager>
<div>
<input id="Button1" onclick="GetMe()" type="button"
value="button" />
</div>
</form>

Following is the code for the javascript and the onclick

<script type="text/javascript">
function GetMe()
{
alert(WebService.HelloWorld());
}
</script>

When I run this program it aborts with the message WebService is undefined.
Would like some advice as to what is missing.

thanks
 
Have found the answer you must have the following to describe your web service

<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<Script.Services.ScriptService()> _
 
Back
Top