473,503 Members | 1,643 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Overloading webmethods

Can I overload a webmethod?

Is there some special mechnism necessary to make this work? If I
compile something like this ...

--- START OF CODE ---
[WebMethod(Description="Call Process", EnableSession=true)]
public XmlElement MyMethod(string ProcessName) {
XmlDocument xml = new XmlDocument();

return xml.DocumentElement;
}

[WebMethod(Description="Call Process with input data", EnableSession=true)]
public XmlElement MyMethod(string ProcessName, XmlDocument UserData) {
XmlDocument xml = new XmlDocument();

return xml.DocumentElement;
}
--- END OF CODE ---
It compiles OK, but I get an exception when I try and access it.

--
Stuart
See headers for PGP Key.
Always remember you're unique, just like everyone else.

Nov 23 '05 #1
2 4538
On Fri, 10 Dec 2004 12:34:42 +0000, Stuart Hemming (via DFN-CIS NetNews
Service) wrote:
Can I overload a webmethod?

Is there some special mechnism necessary to make this work? If I
compile something like this ...

--- START OF CODE ---
[WebMethod(Description="Call Process", EnableSession=true)]
public XmlElement MyMethod(string ProcessName) {
XmlDocument xml = new XmlDocument();

return xml.DocumentElement;
}

[WebMethod(Description="Call Process with input data", EnableSession=true)]
public XmlElement MyMethod(string ProcessName, XmlDocument UserData) {
XmlDocument xml = new XmlDocument();

return xml.DocumentElement;
}
--- END OF CODE ---
It compiles OK, but I get an exception when I try and access it.


You can overload the method in the class file, but it must have a unique
message name. For example on your second overload you might put the
following:

[WebMethod(Description="Call Process with input data",
EnableSession=true,MessageName="MyMethod2")]
--
Tom Porterfield
Nov 23 '05 #2
On 10/12/2004, around 13:50, Tom Porterfield wrote:

TP> You can overload the method in the class file, but it must have a unique
TP> message name.
Top lad! TVM. You next pint is on me.

--
Stuart
See headers for PGP Key.
This week's Clairvoyants Association meeting is canceled due to
unforeseen events.

Nov 23 '05 #3

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

Similar topics

17
4693
by: Terje Slettebø | last post by:
To round off my trilogy of "why"'s about PHP... :) If this subject have been discussed before, I'd appreciate a pointer to it. I again haven't found it in a search of the PHP groups. The PHP...
0
5550
by: mdh | last post by:
I have an application written for mod_perl and Apache that needs to be able to send some XML queries to a WebMethods server for access to corporate systems. I have been attempting to use LWP to...
6
6159
by: Fernando Berretta | last post by:
Hello, Is there some way to truly Overload a WebMethod (Without using MessageName) ?? Thanks in advance, Fernando
4
2399
by: Baldor Renwald | last post by:
How can I make two or more webmethods run under the same transaction? Thanks
14
2590
by: Bert Vandenberghe | last post by:
Hi, I was wondering if there are any best practices on the creation of webmethods? I'll try to explain this a little more: My problem is that we are changing an existing (large) DCOM application...
1
978
by: khr128 | last post by:
I have a well-tested COM object. Ican use it from c# console and windows apps, but WebMethod in a WebService refuses to load this object. The COM object loads into MTA. Any thoughts and/or...
4
1976
by: DraguVaso | last post by:
Hi, For my webservice I need the folowwing security: - all the webmethods must be accesible inside the LAN (for our employees) - by the internet only some of the methods should be accessible (by...
2
982
by: =?Utf-8?B?SXZhbiBBYnJhbW92?= | last post by:
Everything has been fine for years and the code Dim dsNews As DataSet Dim ws As New localhost.Service dsNews = ws.GetNews() was working on my developer PC, but now I get the error: "There is...
0
2047
by: sdtdevelop | last post by:
Hi all, I have build a webservice and now i am trying to call it from webMethods. Binding succeeds but gives me below warning messages: WSDL code: S-9038 Error: Unknown binding style was...
7
1399
by: Killer42 | last post by:
I'm doing some webMethods training, and just wondered - where would be the appropriate forum to ask questions about it?
0
7328
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7458
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
5578
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
5013
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
3167
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
1512
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 ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
380
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.