error handling - byref params not modified if an exception is thro
From: Luis Fajardo (LuisFajardo_at_discussions.microsoft.com)
Date: 09/02/04
- Next message: Elena Kharitidi: "RE: Unable to import binding.. from Namespace..."
- Previous message: Jason Zhou: "Change HTTP header"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 1 Sep 2004 18:33:14 -0700
I noticed the byref parameters doesn't get changed if during the execution of
the web service an exception is thrown.
Sample code:
-->Client
public class WSClient{
public void Execute(){
int i = 0;
try{
WSServer server = new WSServer();
server.Execute(ref i);
}
catch(Exception e){
Console.WriteLine(i.ToString());
}
}
}
-->Server
public class WSServer : System.Web.Services.WebService{
[WebMethod]
public void Execute(ref int i){
i = 100;
throw new Exception("i does't change!!!, too bad!!!");
}
}
Why? I'm having the same problem with .NET Remoting, but local calls
obviously works fine. Work arounds? How should I do it?
Thanks in advance.
Luis Fajardo
- Next message: Elena Kharitidi: "RE: Unable to import binding.. from Namespace..."
- Previous message: Jason Zhou: "Change HTTP header"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|