.NET Samples - XML Web Services created with ASP.NET
This section includes the following samples:
DataService Sample
SessionService Sample
MathService Sample
DataTypes Sample
DataServiceClient Sample
DataTypesClient Sample
SessionServiceClient Sample
MathServiceClient Sample
MatchClient Sample
DataService Sample
This sample demonstrates a simple XML Web service that returns a DataSet retrieved from an SQL database.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
System; System.Data; System.Web; System.Web.Services; System.Data.SqlClient
Classes used in this sample:
SqlDataAdapter; Service; DataSet; DataAdapter; SqlConnection; Table; WebService
SessionService Sample
This sample illustrates how to access ASP.NET intrinsics such as the Session and Application objects from an XML Web service. It also shows how to turn off Session on a per-[WebMethod] basis.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
System; System.Web; System.Web.Services
Classes used in this sample:
Service; Application; String; WebService
MathService Sample
This sample XML Web service adds, subtracts, multiplies, and divides numbers. It demonstrates the fundamentals of defining an XML Web service in ASP.NET.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
System; System.Web; System.Web.Services
Classes used in this sample:
Service; Math; WebService
DataTypes Sample
This sample demonstrates how various data types can be passed to and from an XML Web service.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
System; System.Web; System.Web.Services
Classes used in this sample:
String; Service; Type; Types; WebService; Array
DataServiceClient Sample
This sample client application uses a proxy generated by the Web Services Description Language tool (wsdl.exe) to call the corresponding DataService sample.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
System; System.Web; System.Web.Services; System.Diagnostics; System.Data; System.Web.Services.Protocols; System.Web.Services.Description; System.Xml; System.Xml.Serialization; System.Data.SqlClient
Classes used in this sample:
Service; DataSet; Attribute; DebuggerStepThroughAttribute; Debugger; Debug; DataGrid; Table; Style; AsyncResult; Message; Import; Binding; String; EventArgs; AsyncCallback; Font; Page; SoapDocumentMethodAttribute; Version; Literal; Object; SoapBinding; Header; WebServiceBindingAttribute; Xml; WebService; Url; SoapHttpClientProtocol
DataTypesClient Sample
This sample client application uses a proxy generated by the Web Services Description Language tool (wsdl.exe) to call the corresponding DataTypes sample.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
System; System.Web; System.Web.Services; System.Diagnostics; System.Web.Services.Protocols; System.Web.Services.Description; System.Xml.Serialization; System.Xml
Classes used in this sample:
Attribute; Service; Message; Debug; DebuggerStepThroughAttribute; Debugger; Array; AsyncResult; Style; Types; Type; Binding; SoapBinding; SoapDocumentMethodAttribute; Literal; String; AsyncCallback; Xml; XmlArrayItemAttribute; Version; SoapHttpClientProtocol; Url; Page; Object; WebServiceBindingAttribute; WebService; Import; EventArgs
SessionServiceClient Sample
This sample client application uses a proxy generated by the Web Services Description Language tool (wsdl.exe) to call the corresponding SessionService sample.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
System; System.Web; System.Web.Services; System.Diagnostics; System.Web.Services.Protocols; System.Web.Services.Description; System.Xml.Serialization; System.Xml
Classes used in this sample:
Service; Attribute; Debug; Debugger; DebuggerStepThroughAttribute; AsyncResult; Style; Message; Binding; SoapBinding; AsyncCallback; SoapDocumentMethodAttribute; Version; Literal; EventArgs; Xml; Url; Page; Object; WebServiceBindingAttribute; WebService; Import; SoapHttpClientProtocol
MathServiceClient Sample
This sample client application uses a proxy generated by the Web Services Description Language tool (wsdl.exe) to call the corresponding MathService sample.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
System; System.Web; System.Web.Services; System.Diagnostics; System.Web.Services.Protocols; System.Web.Services.Description; System.Xml.Serialization; System.Xml
Classes used in this sample:
Service; Attribute; Debug; Debugger; DebuggerStepThroughAttribute; Math; Style; AsyncResult; Binding; String; SoapBinding; SoapDocumentMethodAttribute; Literal; AsyncCallback; TextBox; Version; Object; Label; Xml; Url; WebServiceBindingAttribute; Import; Control; SoapHttpClientProtocol; WebService; EventArgs; Exception
MatchClient Sample
This sample demonstrates how to create a client proxy for extracting values from any Web page. A description of the desired values is authored in WSDL format, and the Web Services Description Language tool (wsdl.exe) automatically generates the code to request the page and extract the values using regular expressions.
Link to the online sample documentation
Link to the online sample source code
Namespaces used in this sample:
System; System.Web.Services; System.Web; System.Web.Services.Protocols; System.Diagnostics; System.Xml.Serialization; System.Xml
Classes used in this sample:
Match; Header; Service; Attribute; DebuggerStepThroughAttribute; Debugger; Debug; Url; Version; AsyncResult; Message; MatchAttribute; Exception; UrlParameterWriter; Xml; Import; EventArgs; AsyncCallback; HttpGetClientProtocol; HttpMethodAttribute; TextReturnReader; Object