Why is method overloading not supported in WCF services???

In order to answer this question first we need to understand the following WSDL styles:

1) RPC : Operation oriented say ex: InsertStudent,  <soap:body> element should contain the name of the method that is being invoked </soap:body

2) Document: is data oriented <soap:body> does not care what is being passed in the soap body </soap:body, this style came into the picture because of the limitations of RPC style where schema validation was difficult, included the type information and don not conform to WSI and etc..

Extensions for the above

3)Document/Literal: Microsoft proposed this standard where the soap body element will contain the web method name.

Now imagine a wsdl having the same name in WCF, we can’t because by default all the WCF services conform to the document literal standard where the soap body should include the method name , so this why we cannot have method overloading (same method name but different parameters) in WCF.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: