JG Vimalan's Blog

It is all about coding!

Cannot have two operations in the same contract with the same name, methods…

I was trying to do method overloading in my WCF 4.0 service and the code complied well but, while trying to open the service in test client, it throwed an error,

Cannot have two operations in the same contract with the same name, methods…

The code is as follows,

To fix this issue, I added “Name” attribute in the OperationContract as shown below,

This fixed the issue. And, while viewing the service in test client, observed that, the method name is exposed as  “GetFullNameByID” as shown below,

Advertisements

April 19, 2012 - Posted by | WCF

No comments yet.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: