Does anyone know of a way to have a web service proxy access a public enum from a Web Service. When I create my enum in the Web Service, its values and enum declaration don't come across in the proxy class. I am using it to generate a return code for a soap message and want to compare the return code in the soap message to the enum constants for exception handling.
try{
myObject.DoSomething(); //Generates SOAP Fault
}
catch(SoapException se){
//Convert the SOAP Fault:detail errorcode to integer and compare it to the enumeration constant.
int theErrorCode = Convert.ToInt32(se.Details.SelectSingleNode("ErrorCode").InnerText);
if (theErrorCode = myObject.ErrorEnum.EnumCodeOne){
proccess request...
}
else if(theErrorCode = myObject.ErrorEnum.EnumCodeTwo){
process other request
}
}
Any ideas on how to do this other than explicitly modifiying the proxy and placing the enum in there manually?
No one has replied yet! Why not be the first?
Sign in or Join us (it's free).