Last post Aug 20, 2014 11:37 PM by Shawn - MSFT
Aug 15, 2014 02:35 PM|jnagasuresh|LINK
I have a wcf service which working as expected.
Recently I have added few more method to existing interface and implemented in associated service. I have given operation contracts, service contracts and data contracts properly.
But I am not able to see them in WSDL file when I browse the service. Service is building successful. when updating client reference also not able to see new methods.
Please help with the solution why new methods are updating.
I am using .net 4.5 framework, VS 2012.
Aug 15, 2014 04:24 PM|mgebhard|LINK
This is usually due to service and operational contracts not be decorated properly and/or using private access modifiers. If you truly seek help, post your problematic code!
Aug 18, 2014 05:16 AM|Thirisangu|LINK
Please post your Interface file for further clarification.,(IService.cs)
Aug 20, 2014 11:37 PM|Shawn - MSFT|LINK
For this situation, you should add the [OperationContract] before
the new added method in the interface:
public interface ICalculator
double Add(double n1, double n2);
double Subtract(double n1, double n2);
double Multiply(double n1, double n2);
double Divide(double n1, double n2);
[OperationContract] //This is the new added method in the interface
double NewHello(double n1, double n2);
Then build the WCF service application, and publish it if you host it in the iis, then in the client
test application, you could try to update the corresponding reference within the Service Reference folder.
Then, you could call the new added method as below:
CalculatorClient cc = new CalculatorClient();