How to use SOAP to invoke Web Services developed by C # in an ASP environment

Source: Internet
Author: User
Tags soap web services
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



Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.