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

Passing an [in] parameter to an asp.net web service

Hi,
Consider a class that I need to serialize and send over the wire. On
the receiving end, the serialization bytes have to be re-constructed to
form the object. The mentioned class has got some member variables and
one or more constructors.

[WebMethod()]
public void Test(MyClass c) {}

The question is that is there anyway to control the proxy-generation
for the MyClass class? i.e, how am I supposed to force the
proxy-generator to generate the constuctors? Or should I add the
required constructors on the client side using the partial keyword?
What's the best thing to do when you want to pass a one-way informative
parameter (ie., no functionality embedded except for the constructors)
to a web method?

I would like the client side to create the object normally as follows:

MyWebService.MyClass c = new MyWebService.MyClass(param1, param2);
MyWebService.Test(c);

Is there anyway to achieve such functionality?

TIA,
Mehdi

Aug 13 '06 #1
1 1013
I've tried to do what you are doing and it does not seem to work.

The best you can hope for is
MyWebService.MyClass c = new MyWebService.MyClass();
c.param1 = param1;
c.param2 = param2;
MyWebService.Test(c);


"mehdi" <me***********@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
Hi,
Consider a class that I need to serialize and send over the wire. On
the receiving end, the serialization bytes have to be re-constructed to
form the object. The mentioned class has got some member variables and
one or more constructors.

[WebMethod()]
public void Test(MyClass c) {}

The question is that is there anyway to control the proxy-generation
for the MyClass class? i.e, how am I supposed to force the
proxy-generator to generate the constuctors? Or should I add the
required constructors on the client side using the partial keyword?
What's the best thing to do when you want to pass a one-way informative
parameter (ie., no functionality embedded except for the constructors)
to a web method?

I would like the client side to create the object normally as follows:

MyWebService.MyClass c = new MyWebService.MyClass(param1, param2);
MyWebService.Test(c);

Is there anyway to achieve such functionality?

TIA,
Mehdi

Sep 1 '06 #2

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

Similar topics

4
by: Mark Rae | last post by:
Hi, Can anyone please tell me if it's possible to pass a System.Web.Mail.MailMessage object to a ASP.NET Web Service? Maybe using XML Serialization / Deserialization? I've been asked to...
5
by: James Wong | last post by:
Dear all, I've a web service function and it contains a parameter in System.Text.Encoding. I found that the data type of this parameter in caller application becomes MyWebSvcName.Encoding...
22
by: Arne | last post by:
How do I pass a dataset to a webservices? I need to submit a shoppingcart from a pocket PC to a webservice. What is the right datatype? II have tried dataset as a datatype, but I can't get it to...
2
by: Nab | last post by:
I have just tried to pass parameters to a procedure in VB 2005 and realised that you only need to pass the input parameter. The output parameter's value will be returned without the need to pass it...
10
by: amazon | last post by:
Our vender provided us a web service: 1xyztest.xsd file... ------------------------------------ postEvent PostEventRequest ------------------------------------- authetication authentication...
0
by: amazon | last post by:
I have web service that acceping following parameters.. postev.PostEvent(authentication as ws.authentication, name as string,id as string, exdate as date, parameter() as ws.nameparametervaluepair...
7
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
3
by: Hakan Örnek | last post by:
Hi , I want to parameter passing to my windows sevice. I call service commands like this ; '------------------------------------------------------------ Dim sc As ServiceController sc = New...
8
by: =?Utf-8?B?UmF2aQ==?= | last post by:
Hi, I'm trying to pass values of different data-types to a web-service. I thought it would be easier to box these values and pass them as a System.object parameter, like public void...
7
by: =?iso-8859-1?Q?S=F8ren_M._Olesen?= | last post by:
Hi How do I pass a complex type to a webservice?? What I have is a Class 'MyComplexClass' which lives in it's own dll/namespace. I'd like to pass this class to my webmethod: <WebMethod()_...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.