A
All Smiles
This should be easy, but I just can't figure it out. I have a Web Service that defines a SoapHeader class:
<%@ WebService Language="c#" Class="GetAccount" %>
using System;
using System.Xml;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
public class AccountInfo : SoapHeader {
public string AccountName;
public AccountInfo() {}
}
public class GetAccount : WebService {
public AccountInfo AccInfo;
[WebMethod(),SoapHeader("AccInfo")]
public String[] GetData(String pID) {
return AccInfo.AccountName;
}
}
The code in the aspx page looks like:
AccountInfo ai = new AccountInfo();
GetAccount ga = new GetAccount();
ai.AccountName = "Test Account";
ga.AccInfo = ai;
Somehow, I'm getting:
'GetAccount' does not contain a definition for 'AccInfo'
Any ideas?
Thanks
<%@ WebService Language="c#" Class="GetAccount" %>
using System;
using System.Xml;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
public class AccountInfo : SoapHeader {
public string AccountName;
public AccountInfo() {}
}
public class GetAccount : WebService {
public AccountInfo AccInfo;
[WebMethod(),SoapHeader("AccInfo")]
public String[] GetData(String pID) {
return AccInfo.AccountName;
}
}
The code in the aspx page looks like:
AccountInfo ai = new AccountInfo();
GetAccount ga = new GetAccount();
ai.AccountName = "Test Account";
ga.AccInfo = ai;
Somehow, I'm getting:
'GetAccount' does not contain a definition for 'AccInfo'
Any ideas?
Thanks