Instance validation error: '2' is not a valid value for QueryType. (web service)
- by Anthony Shaw
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?