Expand|Select|Wrap|Line Numbers
- namespace MyWebApp
- {
- /// <summary>
- /// Summary description for FirstSharePointWebService
- /// </summary>
- [WebService(Namespace = "MyWebApp", Name = "FirstSharePointWebService")]
- [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
- [System.ComponentModel.ToolboxItem(false)]
- // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
- // [System.Web.Script.Services.ScriptService]
- [System.Web.Script.Services.ScriptService]
- public class FirstSharePointWebService : System.Web.Services.WebService
- {
- [ScriptMethod]
- [WebMethod]
- public string HelloWorld()
- {
- return "Hello World";
- }
- }
Expand|Select|Wrap|Line Numbers
- this.Controls.Add(new LiteralControl("
- <script language='javascript' type='text/javascript'>(function(){
- alert(1);
- service.useService('http://localhost:22222/12/TEMPLATE/LAYOUTS/AJAX/FirstSharePointWebService.asmx?WSDL','FirstSharePointWebService');
- }());
- function callService() {alert(2);
- MyWebApp.FirstSharePointWebService.HelloWorld(callComplete, callError);
- }
- function callComplete(result){alert(result);}
- function callError(result){alert('ERROR');}
- </script>"));
- this.Controls.Add(new LiteralControl("
- <input type='button' id='pow' value='Get Name' onclick='callService();' />"));
I am guessing it can't find the MyWebApp.FirstSharePointWebService but i'm not sure.
Any pointers tips trick would be massively appreciated. Cheers
Truez