I created a WCF Service on visual studio 2015 with one method that returns a MySqlCommand. When i try to add a reference of the service on another service i get an error:
There was an error downloading 'http://localhost:54740/GetCommand.svc/$metadata'. The request failed with HTTP status 400: Bad Request. Metadata contains a reference that cannot be resolved: 'http://localhost:54740/GetCommand.svc'. Content Type application/soap+xml; charset=utf-8 was not supported by the service. The client and service bindings may be mismatched. The remote server returned an error: (415) Cannot process the message because the content type 'application/soap+xml; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'.. If the service is defined in the current solution, try building the solution and adding the service reference again.
I have searched a lot and i cannot find a solution, the code for the service is as follows:
public class GetCommand : IGetCommand
{
public MySqlCommand getCmd(string q, MySqlConnection con)
{
return new MySqlCommand(q, con);
}
}
and the contract code is:
[ServiceContract]
public interface IGetSqlConnection
{
[OperationContract]
MySqlConnection getConnection(string query);
}
The service is found when i press the discover button, but i cannot add it as a reference. All the other services of the solution are working.
Reference or a Service Reference -> Web Service
? – MethodMan