首先,需要从SoapHeader派生一个类,全部代码如下:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services.Protocols;
namespace wolame
{
public class MySoapHeader: SoapHeader
{
public string _UserID;
public string _Password;
public string _InParam;
public MySoapHeader()
{
}
public string UserID
{
get { return _UserID; }
set { _UserID = value; }
}
public string Password
{
get { return _Password; }
set { _Password = value; }
}
public string InParam
{
get { return _InParam; }
set { _Password = value; }
}
private bool IsValid(string sUserID, string sPasswd, out string sMsg)
{
sMsg = "";
try
{
if(sUs