I created a WebService WCF , and in the interface IService1.cs
I put the signature of the methods
[ServiceContract]
public interface IService1 {
[OperationContract] bool insertConsulta(BConsulta bCos);
[OperationContract] bool alterConsulta(BConsulta bCos);
}
From there I implemented this interface in the web service Service1.svc
, and stayed like this
public class Service1 : IService1 {
NConsulta nCos = new NConsulta();
public bool insertConsulta(BConsulta bCos) {
return nCos.insertConsulta(bCos);
}
public bool alterConsulta(BConsulta bCos) {
return nCos.alterConsulta(bCos);
}
}
Then I referred the Web Service to the project and put it as the name of that reference as localhost
.
In Windows Form I installed the WebService
localhost.Service1 service = new localhost.Service1();
The following problem when I want to consume the web service it gives an error in web service methods that has bool return, in the interface I ask for 1 parameter and when I put service.insertConsulta(bCos);
it I asked for 2 more parameters and it says the following:
void Service1.insertConsulta(BConsulta bCos, out bool insertConsultaResult, out bool insertConsultaResultSpecified)
The other methods that return void
work normally, but those with boolean return appear this error, Dai I do not know what to do!