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?
csharptooth
Member
10 Points
7 Posts
Using Enum with Web Services Proxy
Aug 06, 2003 01:59 PM|LINK
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?