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.
thanksHave found the answer you must have the following to describe your web servi
ce
<WebService(Namespace:="http://tempuri.org/")> _
< WebServiceBinding(ConformsTo:=WsiProfile
s.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
<Script.Services.ScriptService()> _
"barry" wrote:
> 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
>
>
Monday, March 12, 2012
web services and ajax
Labels:
ajax,
alone,
asp,
below,
code,
created,
declarative,
helloworld,
local,
machine,
net,
portionltform,
service,
services,
web
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment