高分求购WEB SERVICES项目源码,作参``学习学习

xhunanpp 2004-04-11 11:49:18
高分求购WEB SERVICES项目源码,作参``学习学习

请问网上有没有WEB SERVICES项目源码下载,作学习用的,
...全文
86 29 打赏 收藏 举报
写回复
29 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
favornwpu 2004-04-17
up
  • 打赏
  • 举报
回复
favornwpu 2004-04-17
up
  • 打赏
  • 举报
回复
xinyu_1980 2004-04-17
UP
  • 打赏
  • 举报
回复
xinyu_1980 2004-04-17
UP
  • 打赏
  • 举报
回复
taosihai1only 2004-04-17
up
  • 打赏
  • 举报
回复
ghost225 2004-04-17
up
  • 打赏
  • 举报
回复
cutezww 2004-04-17
Microsoft Visual Studio .NET 2003\Enterprise Samples\有
  • 打赏
  • 举报
回复
活靶子哥哥 2004-04-17
╭═══╮ ╭═══╮ ╭══════╮   
╰╮ ╭╯ ╰╮ ╭╯ ╰╮ ╭══╮╰╮  
 ║ ║   ║ ║   ║ ║  ╰╮╰╮ 
 ║ ║   ║ ║   ║ ║   ║ ║ 
 ║ ║   ║ ║   ║ ║  ╭╯╭╯ 
 ║ ║   ║ ║   ║ ╰══╯╭╯  
 ║ ║   ║ ║   ║ ╭═══╯   
 ║ ║   ║ ║   ║ ║       
 ╰╮╰╮ ╭╯╭╯   ║ ║       
  ╰╮╰═╯╭╯   ╭╯ ╰╮      
   ╰═══╯    ╰═══╯
  • 打赏
  • 举报
回复
xueqs 2004-04-17
mark
  • 打赏
  • 举报
回复
i三千 2004-04-17
up
  • 打赏
  • 举报
回复
pycys001 2004-04-17
我都不错过
  • 打赏
  • 举报
回复
flashworld 2004-04-16
给我你的E-Mail
  • 打赏
  • 举报
回复
xhunanpp 2004-04-16
gengwei80(唐伯虎点秋香) ( )
你哪是用脚本调用,我是有两个数据库 ,就是两个服务端的数据交换,
你哪种做法不是我所说的,
  • 打赏
  • 举报
回复
xhunanpp 2004-04-16
土匪头 兄: 我的MSN/EMAIL : xhunanpp@hotmail.com 非常感谢
  • 打赏
  • 举报
回复
lingyun_k 2004-04-16
http://expert.csdn.net/Expert/topic/2969/2969445.xml?temp=.353985
  • 打赏
  • 举报
回复
土匪头大哥,我的email:zhangtaomaster@163.com,拜托也给我发一份。
  • 打赏
  • 举报
回复
listhome 2004-04-16
我也想要!帮你UP一下!楼主收到了发给我一份好吗?谢谢!!
  • 打赏
  • 举报
回复
wolftop 2004-04-16
http://www.csharphelp.com/
http://www.codeproject.com/dotnet/
有很多经典的!~去看看吧~不过是E文的!~
  • 打赏
  • 举报
回复
gengwei80 2004-04-15
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Data.OleDb;
using System.Web.UI;
using System.Web.UI.HtmlControls;

namespace Service
{
/// <summary>
/// Service 的摘要说明。
/// </summary>
public class Service : System.Web.Services.WebService
{
public string ConnectionString;
public OleDbConnection Conn;
// public Int32 RecordCount;
public Service()
{
//CODEGEN: 该调用是 ASP.NET Web 服务设计器所必需的
InitializeComponent();
string ConnectionString;
ConnectionString="PROVIDER=SQLOLEDB;Data Source=GISWEB;Initial Catalog=JYJD;User ID=sa;Password=;";
Conn = new OleDbConnection(ConnectionString);
}
[WebMethod(Description="")]
public DataSet GetUserList(int userid)
{
// int i;
OleDbCommand MyCommand = new OleDbCommand("p_LoadUser",Conn);
MyCommand.CommandType = CommandType.StoredProcedure;
OleDbParameter MyPara;
MyPara = MyCommand.Parameters.Add("@userid", SqlDbType.Int);
MyCommand.Parameters["@userid"].Value = userid;
MyPara = MyCommand.Parameters.Add("@msgcount", SqlDbType.Int);
MyPara.Direction = ParameterDirection.Output;
// OleDbDataReader DbCommand = MyCommand.ExecuteReader();
OleDbDataAdapter DbCommand = new OleDbDataAdapter();
DbCommand.SelectCommand = MyCommand;
// RecordCount = (Int32)MyCommand.Parameters["@msgcount"].Value;
DataSet ds = new DataSet();
DbCommand.Fill(ds,"table");
return ds;
// OleDbDataAdapter MyCommand = new OleDbDataAdapter("exec loaduser "+userid,Conn);
// DataSet ds = new DataSet();
// MyCommand.Fill(ds,"table");
// return ds;
}

#region 组件设计器生成的代码

//Web 服务设计器所必需的
private IContainer components = null;

/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{

}

/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}

#endregion



}
}

客户端调用
<html>
<head>
<script language="JavaScript">
var iCallID;
var service_MsgXML = new ActiveXObject("MSXML.DOMDocument");
function init()
{
service.useService("http://gengw/jyjd/service/service.asmx?WSDL","service");
iCallID = service.service.callService("GetUserList",7);
}


</script>
</head>
<body onload="init()">
<div id="service" style="behavior:url(http://gengw/chat/webservice.htc)" onresult="onWSresult()">
</div>
<SCRIPT language="JavaScript1.2">
function onWSresult()
{
if((event.result.error)&&(iCallID==event.result.id))
{
var xfaultcode = event.result.errorDetail.code;
var xfaultstring = event.result.errorDetail.string;
var xfaultsoap = event.result.errorDetail.raw;
alert(xfaultstring);
// Add code to output error information here
}
else
{
var xmlResult = event.result.raw.xml;
// var result = event.result.value;
// alert(result);
if (xmlResult != "" && xmlResult != null)
{

service_MsgXML.loadXML(xmlResult);
maxNum = service_MsgXML.getElementsByTagName("msgcontent").length
column=service_MsgXML.getElementsByTagName("msgcontent").item(0).childNodes
alert(maxNum);
service_ChatMsgs.innerHTML = "";
for (m=0;m<=maxNum-1;m++){
//for(x in service_MsgXML.documentElement.childNodes)
//alert("The method returned the result : " + xmlResult);
// service_ChatList.innerText = service_MsgXML.selectSingleNode("//msgtime").text;
// service_ChatList.scrollTop = 2000;
// mName=column.item(m).tagName;
service_ChatMsgs.innerHTML += service_MsgXML.getElementsByTagName("msgtime").item(m).text+":<br>";
service_ChatMsgs.innerHTML += service_MsgXML.getElementsByTagName("msgcontent").item(m).text+"<br>";
//service_ChatMsgs.innerHTML += "<br>";
//service_ChatMsgs.innerHTML += service_MsgXML.selectSingleNode("//msgcontent").text;
//service_ChatMsgs.scrollTop = 2000;
}
}
window.setTimeout('iCallID = service.service.callService("GetUserList",7);',3000);
}
}
</script>
<Div id="service_ChatMsgs" style="Height:100%;Width:100%;Overflow:Auto;"></Div>
</body>
</html>

  • 打赏
  • 举报
回复
wangyagang 2004-04-15
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;

namespace PCSWebSrv3
{
/// <summary>
/// Summary description for Service1.
/// </summary>
public class Service1 : System.Web.Services.WebService
{
public AuthenticationToken AuthenticationTokenHeader;

public Service1()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}

#region Component Designer generated code

//Required by the Web Services Designer
private IContainer components = null;

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}

#endregion

// WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the project
// To test this web service, press F5

[WebMethod]
public Guid Login(string userName, string password)
{
if ((userName == "Karli") && (password == "Cheese"))
{
Guid currentUser = Guid.NewGuid();
Application["currentUser"] = currentUser;
return currentUser;
}
else
{
Application["currentUser"] = Guid.Empty;
return Guid.Empty;
}
}

[WebMethod]
[SoapHeaderAttribute("AuthenticationTokenHeader",
Direction = SoapHeaderDirection.In,
Required = true)]
public string DoSomething()
{
if ((AuthenticationTokenHeader.InnerToken == (Guid)Application["currentUser"]) && (AuthenticationTokenHeader.InnerToken != Guid.Empty))
{
return "Authentication OK.";
}
else
{
return "Authentication failed.";
}
}
}
}
  • 打赏
  • 举报
回复
加载更多回复(8)
相关推荐
发帖
Web Services

1.2w+

社区成员

.NET技术 Web Services
社区管理员
  • Web Services社区
加入社区
帖子事件
创建了帖子
2004-04-11 11:49
社区公告
暂无公告