.Net Assemblies
References
Using Assemblies
References
Using Assemblies
Create a hello world web service
<%@ WebService Language="C#" Class="HelloService"%> using System; using System.Web.Services; using System.Xml.Serialization; [WebService( Namespace="http://localhost/HelloServices/")] public class HelloService : WebService { [WebMethod] public string SayHello() { return "Hello World!"; } }
Create an aspx web page to consume HelloService
<%@ Page Language="C#" %> <script runat=server> void runService_Click( Object sender, EventArgs e) { HelloService hs = new HelloService(); Label1.Text = hs.SayHello(); } </script> <html> <body> <form id="Form1" runat=server> <asp:Label id="Label1" runat="server">Label</asp:Label> <asp:Button id="runService" onclick="runService_Click" runat="server" Text="Hello"/> </form> </body> </html>
<object name="SingletonObject" type="Test.Singleton, Test" factory-method="CreateInstance"> <property name="Greetings" value="Hello"/> <property name="ExpiryDate" value="4/16/2010"/> </object>