0
votes

I have problem with updating proxy from wcf service.I have interface with one operationcontract and one datacontract,everything was working until I've added one new operationcontract...When I try to update service from client app generated proxy is without new operationcontracts.I've tried use svcutil but without success,the same result. Any idea what's wrong?

[ServiceContract] 
public interface ICreationService 
{ 
    [OperationContract] bool CreateTicket(Ticket ticket); 
    [OperationContract] bool CreateTicket(Ticket ticket,bool asd);
    [OperationContract] IEnumerable<Ticket> GetTickets(); 
} 

[DataContract] 
public class Ticket 
{ 
    [DataMember] 
    public string Name { get; set; } 

    [DataMember] 
    public int Severity { get; set; } 

    [DataMember] 
    public string Description { get; set; } 
} 
1
Can you post the new contract you added and also your bindings? - Tung
[ServiceContract] public interface ICreationService { [OperationContract] bool CreateTicket(Ticket ticket); [OperationContract] bool CreateTicket(Ticket ticket,bool asd); // [OperationContract] IEnumerable<Ticket> GetTickets(); } [DataContract] public class Ticket { [DataMember] public string Name { get; set; } [DataMember] public int Severity { get; set; } [DataMember] public string Description { get; set; } } - user1275513
in order for people to help you, you'll have to show us your web.config, the updated contract, and the exception that you see when you browse to the service in a web browser - Tung

1 Answers

1
votes

WCF does not allow you to have more than one method with the same name (no overloading). You need to change the name of one of your CreateTicket methods, or you can add name attributes to your method like so:

 [OperationContract(Name="CreateTicketNewName")]
 bool CreateTicket(Ticket ticket); 

EDIT

Try returning a concrete type instead of an interface. There's a similar thread on this link