Reputation: 625
I am trying to add a web reference to a WCF service. On browsing to that service through the project explorer, the new function added to that service is not getting listed.
This is my code in the *.svc file
public class Service1 : IService1
{
public string GetData(int value){;}
public CompositeType GetDataUsingDataContract(CompositeType composite){;}
public double Undo(double value, bool isPound){;}
}
Now, while referencing my service as UndoService, my Undo method is not showing up. The following show up by intellisense:
(class) CompositeType
(interface) Service1
(interface) Service1Channel
(class) Service1Client
This might be a naive question, but I am not able to proceed. I probably am missing something big here. Please help!
Upvotes: 0
Views: 1924
Reputation: 1487
You most likely forgot to either add the method to your contract interface or to decorate the contract method with the [Operationcontract]
attribute.
EDIT : I kinda misread the question, apply Mark answer before anything.
Upvotes: 0
Reputation: 32768
The Service1Client
is your proxy class and have to instantiate that class to invoke the service methods.
var proxy = new Service1Client();
proxy.Undo(..)
Upvotes: 2
Reputation: 12904
You need to update the reference if you have added new functionality. You can do this by right clicking the existing reference entry and selecting update, this will download the updated service contract.
Upvotes: 1