views:

515

answers:

2

I have a web service that I am passing an enum

public enum QueryType {
    Inquiry = 1
    Maintainence = 2
}

When I pass an object that has a Parameter of QueryType on it, I get the error back from the web service saying that '2' is not a valid value for QueryType, when you can clearly see from the declaration of the enum that it is.

I cannot change the values of the enum because legacy applications use the values, but I would rather not have to insert a "default" value just to push the index of the enum to make it work with my web service. It acts like the web service is using the index of the values rather than the values themselves.

Does anybody have a suggestion of what I can do to make it work, is there something I can change in my WSDL?

+1  A: 
Tuzo
Unfortunately, this also did not change the error that I received.
Anthony Shaw
I will try to post up a better code sample of what I'm working with. Maybe it's something wierd that we're doing in our DLL and web service.
Anthony Shaw
Yes, please provide a sample.
Tuzo
A: 

Try adding the Flags() attribute to the QueryType definition.

tmp