473,498 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using REF for parmater in web service

Team,
We need some guidance here. We are developing a web service to expose to
external system. We are not sure which is the best path to take. We have
multiple input fields required and a few output fields. We are thinking to
either 1) Make all input fields one class and have one parameter for our web
service of this object type and make all output fields a second class and
have return type of our web method return an object of this type ----- or
----- 2) Put all fields (in & out) in one class and use 'ref' before our parm
of one object. Then our code would simply update the output fields that are
in this input object and the calling party could interrogate the object upon
return.

Does REF negatively impact web service performance?

What are thoughts we should consider in making this decsion?

1) [WebMethod]
public outputclass testservice(inputclass1 inputobject)

2) [WebMethod]
public void testservice(ref inputclass1 inputobject)

Thank you,
Tim
Nov 23 '05 #1
2 1948
Hi Tim,

Welcome here.
As for the webservice parameters defining question when there're multiple
input and output parameters, IMO , I'd strongly recommend you use a single
class to encapsulate all the output parameters (if possible , also input
parameters:)). The reason is mainly considered from webservice's
Interoperablitiy. For webservice which will be exposed to external system,
it is possible to be called by multiple heterogenous client platform.
Though Byref parameters are supported by many programming platform well, it
is not quite interop friendly. However, using Single class to encapsualte
mutliple parameters can let us using .net's XML serizliation attribute to
conveniently control the class's output XML format (the final generated
type schema in wsdl...) which can help improve interoperability of our
webservice.
In addition, generally speaking , using a class to encapsulate mulitple
parameters will somewhat hurt the performance(since the output xml's size
will increase), but I think that worth it and from real world perspective,
the overall performance will be consist of many other facts(such as total
message size, network condition...).

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
Thread-Topic: Using REF for parmater in web service
thread-index: AcXbHyqpSwk9Ha5eQIOaNLIyCgK43A==
X-WBNR-Posting-Host: 192.76.82.90
From: =?Utf-8?B?VGltIFJleW5vbGRz?= <ti**********@online.nospam>
Subject: Using REF for parmater in web service
Date: Thu, 27 Oct 2005 10:52:15 -0700
Lines: 24
Message-ID: <0A**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8391
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Team,
We need some guidance here. We are developing a web service to expose to
external system. We are not sure which is the best path to take. We have
multiple input fields required and a few output fields. We are thinking to
either 1) Make all input fields one class and have one parameter for our
web
service of this object type and make all output fields a second class and
have return type of our web method return an object of this type ----- or
----- 2) Put all fields (in & out) in one class and use 'ref' before our
parm
of one object. Then our code would simply update the output fields that are
in this input object and the calling party could interrogate the object
upon
return.

Does REF negatively impact web service performance?

What are thoughts we should consider in making this decsion?

1) [WebMethod]
public outputclass testservice(inputclass1 inputobject)

2) [WebMethod]
public void testservice(ref inputclass1 inputobject)

Thank you,
Tim

Nov 23 '05 #2
Hi Tim,

Have you got any further ideas on this question or does my suggestion helps
you a little? If there're anything else we can help, please feel free to
post here.

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
X-Tomcat-ID: 61740691
References: <0A**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_0001_4EDA4676"
Content-Transfer-Encoding: 7bit
From: st*****@online.microsoft.com (Steven Cheng[MSFT])
Organization: Microsoft
Date: Fri, 28 Oct 2005 03:36:25 GMT
Subject: RE: Using REF for parmater in web service
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices
Message-ID: <1e**************@TK2MSFTNGXA01.phx.gbl>
Newsgroups: microsoft.public.dotnet.framework.webservices
Lines: 189
Path: TK2MSFTNGXA01.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8398
NNTP-Posting-Host: TOMCATIMPORT1 10.201.218.122

Hi Tim,

Welcome here.
As for the webservice parameters defining question when there're multiple
input and output parameters, IMO , I'd strongly recommend you use a single
class to encapsulate all the output parameters (if possible , also input
parameters:)). The reason is mainly considered from webservice's
Interoperablitiy. For webservice which will be exposed to external system,
it is possible to be called by multiple heterogenous client platform.
Though Byref parameters are supported by many programming platform well, it
is not quite interop friendly. However, using Single class to encapsualte
mutliple parameters can let us using .net's XML serizliation attribute to
conveniently control the class's output XML format (the final generated
type schema in wsdl...) which can help improve interoperability of our
webservice.
In addition, generally speaking , using a class to encapsulate mulitple
parameters will somewhat hurt the performance(since the output xml's size
will increase), but I think that worth it and from real world perspective,
the overall performance will be consist of many other facts(such as total
message size, network condition...).

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)


--------------------
Thread-Topic: Using REF for parmater in web service
thread-index: AcXbHyqpSwk9Ha5eQIOaNLIyCgK43A==
X-WBNR-Posting-Host: 192.76.82.90
From: =?Utf-8?B?VGltIFJleW5vbGRz?= <ti**********@online.nospam>
Subject: Using REF for parmater in web service
Date: Thu, 27 Oct 2005 10:52:15 -0700
Lines: 24
Message-ID: <0A**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.framework.webservices
NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.2.250
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGXA02.phx.gbl!TK2MSF TNGXA03.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl
microsoft.public.dotnet.framework.webservices:8391
X-Tomcat-NG: microsoft.public.dotnet.framework.webservices

Team,
We need some guidance here. We are developing a web service to expose to
external system. We are not sure which is the best path to take. We have
multiple input fields required and a few output fields. We are thinking to
either 1) Make all input fields one class and have one parameter for our
web
service of this object type and make all output fields a second class and
have return type of our web method return an object of this type ----- or
----- 2) Put all fields (in & out) in one class and use 'ref' before our
parm
of one object. Then our code would simply update the output fields that are
in this input object and the calling party could interrogate the object
upon
return.

Does REF negatively impact web service performance?

What are thoughts we should consider in making this decsion?

1) [WebMethod]
public outputclass testservice(inputclass1 inputobject)

2) [WebMethod]
public void testservice(ref inputclass1 inputobject)

Thank you,
Tim

Nov 23 '05 #3

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

Similar topics

0
8329
by: grutta | last post by:
I am writing a windows service that will recieve notification when a USB Device is insterted into the machine. I have used the RegisterDeviceNotification and the RegisterServiceCtrlHandlerEx with...
6
2150
by: Nathan Kovac | last post by:
Yesterday afternoon I was getting the following errors in a windows service: 'DatabaseManager.DataComponent', 'Error', '3 Errors: Line: 0 - Metadata file 'ScriptingMethods.dll' could not be found...
14
5731
by: pmud | last post by:
Hi, I need to use an Excel Sheet in ASP.NET application so that the users can enter (copy, paste ) large number of rows in this Excel Sheet. Also, Whatever the USER ENETRS needs to go to the...
3
5064
by: Michael Hoehne | last post by:
Hi, I'm currently facing a problem with a mixed environment using .NET 1.1 and ..NET 2.0 web services. We have a client application (the "client", system 1) running on .NET 2.0/WinXP, calling...
1
3303
by: Sandy | last post by:
I am defining a web service to receive data that represents an application form and that returns a message indicating if the application form has been successfully validated or not, listing any...
3
13759
by: =?Utf-8?B?RGFuZGFuIFpoYW5n?= | last post by:
Now I have a web application, a web service and a SQL Server database. The Web application will invoke the web service, the web service invokes the SQL Server stored procedure. I let the web...
0
2662
by: =?Utf-8?B?TWFuaQ==?= | last post by:
Hi All, Problem in deploying my WebService developed using Asp.net WebServices 2005. I have designed simple WebService using Asp.net Webservices 2.0 , The webservice look this , using System;...
25
11610
smithj14
by: smithj14 | last post by:
I have a form that has an option group (fraReports) which holds a list of reports to print. This part works fine. I select a report name and click print and that report opens. Now I want to add a...
7
2982
by: chazzy69 | last post by:
Ok basically i need to figure out why i cant pass a variable as a parmater in the fwrite function. heres the code that does NOT work - $output = "hello world"; //note not the actual string...
0
7126
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
7005
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
7168
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
7381
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...
0
5465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3096
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1424
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.