I created application page in empty sharepoint page. Then i added service reference to my wcf service hosted outside sharepoint farm. It added reference successfully. But when i initialise
var mySer = new MyService();
i get error
Could not find default endpoint element that references contract 'MyService.IMyService' in the ServiceModel client configuration section. This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."
So then i added web reference instead of service reference. But when i access some of its methods i get error
SOAP header action was not found.
What is correct way to consume web service in sharepoint 2013 which are created outside farm.
When i consume same WCF service in normal asp.net application then it works. I add service reference in asp.net application and it works.
Update1 when i add webreference i dont see any app.config created. Is this might an issue?