Services|web
How to use SOAP to invoke the Web services developed by C # in an ASP environment, as the owner of. NET Web Services, many friends ask me how to invoke Web services in other environments, but the principle is simple, and everyone knows that web Services are based on the SOAP protocol, and in other environments it is natural to use SOAP to access Web services.
Here's a concrete example to illustrate the calling process.
Development environment: Windows 2000
SOAP Tookit3.0
Iis
I wrote the following Web Services in C #:
Using System;
Using System.Collections;
Using System.ComponentModel;
Using System.Data;
Using System.Data.SqlClient;
Using System.Diagnostics;
Using System.Web;
Using System.Web.Services;
Namespace Webservice_1
{
public class Service1:System.Web.Services.WebService
{
String Err_message;
SqlDataAdapter My_adapter;
DataSet ds = new DataSet ();
DataSet ds1 = new DataSet ();
DataSet Ds_err;
DataSet Ds_value = new DataSet ();
DataTable mydatatable;
Public Service1 ()
{
InitializeComponent ();
}
Private System.Data.SqlClient.SqlConnection SqlConnection1;
#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 ()
{
This.sqlconnection1 = new System.Data.SqlClient.SqlConnection ();
//
SqlConnection1
//
this.sqlConnection1.ConnectionString = "Data source=qieyj;initial catalog=photos;persist security Info=false;user id= Sa;w "+
"Orkstation id=qieyj;packet size=4096";
}
<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);
}
[1] [2] Next page