Passing an enum to a web method

  • Thread starter Thread starter Tony
  • Start date Start date
T

Tony

Does anyone know how to pass an enum to a web method?

public enum RptSetStatus
{
PendingApproval,
Active,
}

[WebMethod]
public void SetRptSetLoadComplete(Guid oUserInstance, int nRptSetId,
RptSetStatus eRptSetStatus)
{

}

Tony
 
Tony said:
Does anyone know how to pass an enum to a web method?

Hi Tony,

if you are using .NET framework to call the web service, in the generated
proxy class on the client should be a method definition that would allow you
to pass the enum. Additionaly you can apply XmlEnumAttribute to your enum to
describe what value you want to serialize over the wire.

Regards,
 
Yes, the client is a v2.0 win forms client application.
I get compiler errors when attempting to use the enum - so if this is
possible, I must be doing something wrong..

Tony
 
Tony said:
Yes, the client is a v2.0 win forms client application.
I get compiler errors when attempting to use the enum - so if this is
possible, I must be doing something wrong..

Tony.

it would be helpful to see some sample code that is causing the error.

Martin
 

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

Similar Threads

about enum 3
Enum Extentions 7
Enum TypeConverter 3
Converting Enums (c#) 2
Passing enums to a method 5
Serializing an enum variable 3
Wrapping/Using Unmanaged Enums 1
enum problems 5

Back
Top