Overloading Web Service Calls

D

Doug

Hello,
For a long time we've been told that you can't overload web service
calls but recently we found a way to do it using the WebMethod
attribute as in the example below. This will allow us as you can see
to have two web service methods of the same name and will show them as
such in intellisense.

I am wondering if there is any concern in doing this? Is there any
documentation anywhere that explains what might be happening with SOAP
that could make doing this a bad idea? Generally just looking for any
information at all that could guide us in whether or not we should be
doing this on a regular basis.


[WebMethod(MessageName="GetUsersForRuleAndOneSubLevel")]
public DataSet GetUsersForRule(string szRule, string szLevel1, string
szUserId)

[WebMethod(MessageName="GetUsersForRuleAndTwoSubLevels")]
public DataSet GetUsersForRule(string szRule, string szLevel1, string
szLevel2,
string szUserId, string szBusinessUnit)
 
J

John Timney \(Microsoft MVP\)

From what I recall of reading through the WS specification its fully
supported. As such you should probably have no issues with it.

--
Regards

John Timney
Microsoft Regional Director
Microsoft MVP
 
T

Ted Harper

For a long time we've been told that you can't overload web service
calls but recently we found a way to do it using the WebMethod
attribute as in the example below. This will allow us as you can see
to have two web service methods of the same name and will show them as
such in intellisense.

If it's an issue for you, test also using the Microsoft Office Web
Services Toolkit as a client to your interface with the overloaded
webservice method names.

I remember last year we had some problem with this toolkit (ie with
the VBA glue code its wizard generates) and overloaded web service
methods, and we changed to unique method/webservice names to avoid it.

I can't remember the specifics now, but I know we ended up deciding it
was easier for us and our customers (who use that Toolkit with Excel
to build custom frontends and reports against our application) if we
changed to non-overloaded method names.


ted.h.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top