473,385 Members | 1,838 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,385 software developers and data experts.

WebMethod parameter ByRef

Hi,
Got this C# WebService I must Use :
[WebMethod]
public double BackwardPerf(ref double[] pRet, double[] pValues)
{
FinanceLibMapperClass mapperLib = new UBPFinanceLibMapperClas();
System.Array pRetArray = (System.Array) pRet;
System.Array pValuesArray = (System.Array) pValues;
double res=mapperLib.BackwardPerf(ref pRetArray, ref pValuesArray);
//pRetArray is correctly filled
return res;
}

So, in my app, I try this :
Dim pRetVector() As Double
ReDim pRetVector(pValues.Rows.Count - 1)
oWsLibFin.AAMG_BackwardPerf(pRetVector, pValues)
'pRetVector = {(0,0,0.....)
Return pRetVector

If I make a break point in the Web Service when the doubleArray is
filled, I can see the values... But in the end, pRetVector is a All
Zero Values array...

The ByRef declaration does not seem to work.
Do I Miss something ?

Thks for help.

Nov 21 '05 #1
2 2429
I have the same problem using dataset as parameter.
may someone help us?
"Franck" wrote:
Hi,
Got this C# WebService I must Use :
[WebMethod]
public double BackwardPerf(ref double[] pRet, double[] pValues)
{
FinanceLibMapperClass mapperLib = new UBPFinanceLibMapperClas();
System.Array pRetArray = (System.Array) pRet;
System.Array pValuesArray = (System.Array) pValues;
double res=mapperLib.BackwardPerf(ref pRetArray, ref pValuesArray);
//pRetArray is correctly filled
return res;
}

So, in my app, I try this :
Dim pRetVector() As Double
ReDim pRetVector(pValues.Rows.Count - 1)
oWsLibFin.AAMG_BackwardPerf(pRetVector, pValues)
'pRetVector = {(0,0,0.....)
Return pRetVector

If I make a break point in the Web Service when the doubleArray is
filled, I can see the values... But in the end, pRetVector is a All
Zero Values array...

The ByRef declaration does not seem to work.
Do I Miss something ?

Thks for help.

Nov 21 '05 #2
Ref value, especially array, often work badly.
I suggest you use DataSet instead.
"Mauricio Pires" <Ma***********@discussions.microsoft.com> wrote in message
news:D0**********************************@microsof t.com...
I have the same problem using dataset as parameter.
may someone help us?
"Franck" wrote:
Hi,
Got this C# WebService I must Use :
[WebMethod]
public double BackwardPerf(ref double[] pRet, double[] pValues)
{
FinanceLibMapperClass mapperLib = new UBPFinanceLibMapperClas();
System.Array pRetArray = (System.Array) pRet;
System.Array pValuesArray = (System.Array) pValues;
double res=mapperLib.BackwardPerf(ref pRetArray, ref pValuesArray);
//pRetArray is correctly filled
return res;
}

So, in my app, I try this :
Dim pRetVector() As Double
ReDim pRetVector(pValues.Rows.Count - 1)
oWsLibFin.AAMG_BackwardPerf(pRetVector, pValues)
'pRetVector = {(0,0,0.....)
Return pRetVector

If I make a break point in the Web Service when the doubleArray is
filled, I can see the values... But in the end, pRetVector is a All
Zero Values array...

The ByRef declaration does not seem to work.
Do I Miss something ?

Thks for help.

Nov 21 '05 #3

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

Similar topics

2
by: Alin Popovici | last post by:
Hi! I have this problem. I am sending as a parameter for a webmethod a string containing '\r\n' sequences. For some reason, when I debug my webmethod, the paramter is received with the carriage...
2
by: Peter McEvoy | last post by:
Folks, I've been building a Webservice API for a contract that will be exposed to the internet at large. There are two endpoints, and each endpoint contains a number of webmethods. Every...
6
by: **Developer** | last post by:
Notice below I sometimes used the "A" version. I found by cut-and-try that only the "A" version would work correctly. Anyone have a suggestion of why the "W" version would not work correctly? ...
20
by: Brien King | last post by:
If I have a parameter that has an Object type (as opposed to something like a string), can I make that parameter a CONST? Right now, if you pass an object into a sub/function, that sub/function...
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...
2
by: MrDotNet | last post by:
Hi I want pass NameValueCollection as parameter in webmethod. I try it but that give me error. Here is Error. You must implement the Add(System.String) method on...
5
by: John | last post by:
Hi Is it possible to pass a whole record to a webmethod? How? Thanks Regards
3
by: Geoff | last post by:
In this code I am trying to pass an image, as a parameter, out of the procedure PickCard. The code will not support this. How do I pass an image as a parameter? Thanks again Geoff
2
by: JB | last post by:
Hi All, I'm pulling my hair over this and could really do with a bit of help. I'm using various different enums as bit fields and I'd like to create a set of generic Functions or Subs to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.