web services and ajax

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
 
G

Guest

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()> _
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top