er的自定义类
/// </summary>
public class ValidateSoapHeader : System.Web.Services.Protocols.SoapHeader
{
public ValidateSoapHeader()
{
}
public ValidateSoapHeader(string name, string password, DateTime dt)
{
this.name = name;
this.password = password;
this.exDate = dt;
}
private string name;
public string Name
{
get { return name; }
set { name = value; }
}
private string password;
public string Password
{
get { return password; }
set { password = value; }
}
private DateTime exDate;
public DateTime ExDate
{
get { return exDate; }
set { exDate = value; }
}
}
Flex的mxml、as代码
mxml
以下是引用片段:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" fontFamily="simsun" fontSize="12">
<mx:Script>
<![CDATA[
import WebServiceUtility.Info;
import mx.rpc.events.FaultEvent;
import mx.rpc.events.ResultEvent;
import mx.rpc.soap.SOAPHeader;
private function SendRequest():void
{
var content:Info = new Info();
content.Name = UserName.text;
content.Password = PassWord.text;
content.ExDate = new Date(2010, 3, 10);
//关键在QName的构造函数
//第一个参数要和.Net的WebService的名称空间相同
//第二个参数要和.Net的Web