473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

error handling - byref params not modified if an exception is thro

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
Nov 21 '05 #1
0 896

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Logico | last post by:
Hi everybody, I've tried to use the byref keyword for passing arguments to subroutines and functions in my ASP pages with VBScript, but it seems that both byref and byval are irrilevant, as simple...
9
by: Tyler | last post by:
I am attempting to extend a legacy VB6 application by making it use a .NET component written in C# exposed through COM interop. Everything appeared to be going well (VB application creates the...
0
by: Mike | last post by:
Hi, I am trying to insert parameters into a stored procedure using DAAB (see code at the bottom of this post). I am getting the following error: Object reference not set to an instance of an...
0
by: Jimmy | last post by:
I have a web page that displays data from a sql server db. I'm using a stored procedure to return data from a field of type text as an OUTPUT parameter. How can I use an OUTPUT parameter of...
14
by: Niklas | last post by:
Hi What I have learned is that a variable is just a reference when dealing with Objects. Are you supposed to use ByVal or ByRef in functions? They produce the same result or have I missed...
6
by: Ken | last post by:
When running a program in the debugger, what would cause it to crash without any error messages? I get "The program has exited with code 0 (0x0)". The program is a MDI app with threading for...
2
by: DazedAndConfused | last post by:
I converted a C# example of using dll crypt32 to VB .NET. The converted example fails when Encypting/Decypting. I found that if instead of defining a variable as and setting the values for...
7
by: Brad | last post by:
I have several web apps which download content to client (pdf, tif, etc) by writing out content in an aspx page. I've recently upgraded these from 1.1 to 2.0....and they all seem to work fine...
7
by: Kath | last post by:
Hi, I hope this is the most relevant newsgroup for this post. I have a VB.NET app that uses the MapPoint component, and in my app I use pushpins to display/retrieve GPS locations....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.