SoapHeader problem

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top