Web C # Under the Webservcie implementation code, very simple to see what kind of function is completed
Using System;
Using System.Collections;
Using System.ComponentModel;
Using System.Data;
Using System.Diagnostics;
Using System.Web;
Using System.Web.Services;
Namespace WebHelloZ5
{
<summary>
Summary description of the Service1.
</summary>
public class Service1:System.Web.Services.WebService
{
Public Service1 ()
{
CodeGen: This call is required by the ASP.net Web service designer
InitializeComponent ();
}
#region Component Designer generated code
Required by the WEB service designer
Private IContainer components = null;
<summary>
Designer supports required methods-do not use the Code editor to modify
The contents of this method.
</summary>
private void InitializeComponent ()
{
}
<summary>
Clean up all resources that are in use.
</summary>
protected override void Dispose (bool disposing)
{
if (disposing && components!= null)
{
Components. Dispose ();
}
Base. Dispose (disposing);
}
#endregion
WEB Services Sample
HelloWorld () sample service return string Hello World
To build, uncomment the following lines, and then save and build your project
To test this WEB service, press the F5 key
[WebMethod]
public string HelloWorld1 ()
//{
Return to "Hello World";
//}
1 initialization parameter list (setclientstruct (&__params, 0);)
|
V
2. Generate Send Data request (Generateresponse (GetWriteStream ()); SendRequest (_t ("SOAPAction: \" http://tempuri.org/helloworld\ "\ r \ n");)
|
V
3. Receive and parse response data (Beginparse (__atlsoap_spreadstream);)
|
V
4. clean-up work
The process is similar to the above if the analysis is implemented. asmx? The WDSL file can be used to add Web references to vs.
The rest is mainly the processing of special symbols and the conversion of types.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.