如何在ASP环境下利用SOAP来调用C#开发的Web Services
如何在ASP环境下利用SOAP来调用C#开发的Web Services,作为.NET Web Services的斑竹,很多朋友都问我如何在其他环境下调用Web Services,原理其实很简单,大家都知道Web Services是基于SOAP协议通信的,在其他环境下自然可以利用SOAP来访问Web Services了。
下面我就一个具体的例子来说明调用过程。
开发环境:windows 2000
SOAP Tookit3.0
IIS
我用C#写了如下一个Web Services:
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
//Web 服务设计器所必需的
private IContainer components = null;
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </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>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
[1] [2] 下一页
- · ASP程序编写完整的一个IP所在地搜索类
- · 用ASP读取网卡MAC地址
- · ASP程序中使用断开的数据记录集
- · 用ASP+XMLHTTP编写一个天气预报程序
- · 简单介绍ASP中Cache技术的应用
- · 如何使用ASP记录在线用户的数量
- · 在ASP应用程序中限制重复提交同一表单
- · 用ASP实现远程抓取网页到本地数据库
- · ASP程序中提供在线文章翻译功能
- · 在ASP应用程序中加入智能搜索
- · 20种看ASP程序源码的方法及工具
- · ASP程序实现在HTML中显示文章被阅读的次数
- · ASP对excel的操作
- · ASP有函数可以把某个网页通过STREAM下载
- · ASP设计动态页中服务器端的处理
- · ASP应用程序设计的Web状态管理分析
- · 如何轻松打造ASP计数器
- · 用ASP构建音乐服务器的方法
- · 在ASP中操作HTTP报头方法分析
- · 如何开始一个ASP网站的设计
- · 在ASP中访问和更新Cookies集合
- · 多个域名后缀同时查询的域名查询系统
- · 用ASP做资源管理器的树形目录
- · 动易2005版网站通用标签
- · 返回一个ASP页面执行后的静态HTML代码
- · Asp Object 之:PICS
- · Asp Object 之:Redirect
- · Asp Object 之:Flush
- · Asp Object 之:AddHeader
- · Asp Object 之:AppendToLog
- · Asp Object 之:BinaryWrite
- · Asp Object 之:Clear
- · Asp Object 之:ClientCertificate
- · Asp Object 之:Expires
- · Asp Object 之:IsClientConnected
- · Asp Object 之:Request
- · Asp Object 之:TotalBytes
- · Asp Object 之:Request.Cookies
