Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2005

Tip: Looking for answers? Try searching our database.

Using REF for parmater in web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Tim Reynolds - 27 Oct 2005 18:52 GMT
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
Steven Cheng[MSFT] - 28 Oct 2005 04:36 GMT
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

Signature

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?= <tim.reynolds@online.nospam>
Subject: Using REF for parmater in web service
Date: Thu, 27 Oct 2005 10:52:15 -0700
Lines: 24
Message-ID: <0A112FDD-65E3-426D-876B-C29529860CE3@microsoft.com>
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!TK2MSFTNGXA03.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
Steven Cheng[MSFT] - 01 Nov 2005 14:55 GMT
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

Signature

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

--------------------
X-Tomcat-ID: 61740691
References: <0A112FDD-65E3-426D-876B-C29529860CE3@microsoft.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="----=_NextPart_0001_4EDA4676"
Content-Transfer-Encoding: 7bit
From: stcheng@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: <1e4fSD32FHA.1172@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

Signature

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?= <tim.reynolds@online.nospam>
Subject: Using REF for parmater in web service
Date: Thu, 27 Oct 2005 10:52:15 -0700
Lines: 24
Message-ID: <0A112FDD-65E3-426D-876B-C29529860CE3@microsoft.com>
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!TK2MSFTNGXA03.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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.