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

WebMethods Overloading

Hello,

Is there some way to truly Overload a WebMethod (Without using MessageName)
??

Thanks in advance,
Fernando
Nov 21 '05 #1
6 6157
Nope, sorry. You can overload all you want in C# but you won't be able to
get that "expressed" in the WS interface definition.

--

Klaus H. Probst, MVP
http://www.vbbox.com/
"Fernando Berretta" <fe**@softhome.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello,

Is there some way to truly Overload a WebMethod (Without using MessageName) ??

Thanks in advance,
Fernando

Nov 21 '05 #2
Klaus,

Thanks for your prompt response.
This means that if I need to add a new paramater to a webmethod wich is
already deployed, the backward compatibility is dead ? How do you think is
the best way to deal with this ? Branching ws and making diferent
uncompatible ws versions ?

Regards,
Fernando
"Klaus H. Probst" <us*******@vbbox.com> wrote in message
news:uR**************@TK2MSFTNGP10.phx.gbl...
Nope, sorry. You can overload all you want in C# but you won't be able to
get that "expressed" in the WS interface definition.

--

Klaus H. Probst, MVP
http://www.vbbox.com/
"Fernando Berretta" <fe**@softhome.net> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello,

Is there some way to truly Overload a WebMethod (Without using

MessageName)
??

Thanks in advance,
Fernando


Nov 21 '05 #3
Fernando,

"Fernando Berretta" <fe**@softhome.net> wrote in message
news:u1**************@TK2MSFTNGP11.phx.gbl...
This means that if I need to add a new paramater to a webmethod wich is
already deployed, the backward compatibility is dead ?
Pretty much, yeah.
How do you think is
the best way to deal with this ? Branching ws and making diferent
uncompatible ws versions ?


Tricky =) Some people will do things like these:

public void Blah(int x) ...
public void Blah1(int x, string y)...
public void Blah2(int x, single y)...

and so on. Or, yes, branching and different URLs
(http://domain.tld/ws/blah1.0/ and http://domain.tld/ws/blah1.1/, ad
nauseam).

It's not pretty.

--
Klaus H. Probst, MVP
http://www.vbbox.com/

Nov 21 '05 #4
MJ
Would defining your methods using Reference Type instead of value
types go someway to delivering what you want without branching?

eg.

public class RequestThing()
{
public int x;
public int y;
public string z;
public string w;

public RequestThing()
{
}
}

[WebMethod]
public ResponseThing DoRequest(RequestThing thing)
{
.......
}

The logic could look at non null values in the deserialized 'thing'
and call the appropriate methods internally. Thus there would only be
one interface that is both future proof and backward compatible?
"Klaus H. Probst" <us*******@vbbox.com> wrote in message news:<OI**************@TK2MSFTNGP10.phx.gbl>...
Fernando,

"Fernando Berretta" <fe**@softhome.net> wrote in message
news:u1**************@TK2MSFTNGP11.phx.gbl...
This means that if I need to add a new paramater to a webmethod wich is
already deployed, the backward compatibility is dead ?


Pretty much, yeah.
How do you think is
the best way to deal with this ? Branching ws and making diferent
uncompatible ws versions ?


Tricky =) Some people will do things like these:

public void Blah(int x) ...
public void Blah1(int x, string y)...
public void Blah2(int x, single y)...

and so on. Or, yes, branching and different URLs
(http://domain.tld/ws/blah1.0/ and http://domain.tld/ws/blah1.1/, ad
nauseam).

It's not pretty.

Nov 21 '05 #5

"MJ" <sy******@hotmail.com> wrote in message
news:64**************************@posting.google.c om...
Would defining your methods using Reference Type instead of value
types go someway to delivering what you want without branching?


Yes, this would be a good solution if your scenario merits it. Using an
opaque message-based parameter "blob" that can be serialized over the wire
is a form of service decoupling that saves you from breaking client code
down the road because it's always aggregational - as you "grow" the message
descriptor structure your older clients only have to fill in certain things
and you can compensate for that on the service side very easily. A version
field also helps =)

Normally you'd do this as a mini-SOAP over SOAP, where your 'thing' (no pun
intended <g>) is perhaps a key-value pair style structure that contains
parameters and their values. So, this:

void DoThing(int x, double y) {
...
}

becomes:

void DoThing(string z) {
...
}

where 'z' is maybe something like this:

<xml>
<methodCall>
<param name="x" value="2" />
<param name="y" value="44.5" />
</methodCall>

Now, the problem with this is expressing complex types, which is something
SOAP does well to begin with. But in most cases you can wing it relatively
easy. You "dehydrate" the container before dispatching it (serialization)
and "re-hydrate" it on arrival (deserialization). Mostly straightforward.

A design based on this 'pattern' can be called a "message-based transport
architecture", and some of us were doing that long before SOAP was a gleam
in Don Box's eyes =)

It was actually an excellent way to do additional decoupling for COM-based
services that exposed behavior via independent interfaces that callers would
consume through a configurable programmatic ID. This would save you from
having interfaces that looked like bad Hollywood sequels:

IThing
IThing2
IThing3::DoThing4
....

You could write books about this stuff, really =)
--
Klaus H. Probst, MVP
http://www.vbbox.com/

Nov 21 '05 #6
Fernando Beretta wrote:
Thanks for your prompt response.
This means that if I need to add a new paramater to a webmethod wich
is
already deployed, the backward compatibility is dead ? How do you
think is
the best way to deal with this ? Branching ws and making diferent
uncompatible ws versions ?


My suggestion would be to stop thinking in terms of C# and start thinking in terms of WSDL and XML Schema. I realize it's nice to write Web Services really quick and have the IDE and ASP.NET/WSE do a lot of nice translating for you to/from .NET types, but in the end it's just going to bite you. My suggestion would be to take XmlElement and return XmlElement in your method signatures and start working at the XML level. If you're using WSE you can even take it a step further and take and return SoapEnvelope.

Then overloading becomes as simple as your message type allowing the choice between multiple XML Schema types and inside the web method switching on the namespace of the element passed to forward to the correct internal handler. Versioning now becomes a matter of schema versioning, which there are some well known patterns for.

HTH,
Drew

Nov 21 '05 #7

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

Similar topics

17
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
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...
4
by: Baldor Renwald | last post by:
How can I make two or more webmethods run under the same transaction? Thanks
14
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
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
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
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
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
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
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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...

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.