I have WCF Service that is hosted in IIS. I want to call inside WebAPI.How it will be called.
I am New in Web-API
1. Get the service address of the WCF Service. Example could be http://localhost:59194/myservice.svc
2. In Web API project, Add Service Reference. Go to reference > add service reference > type in address and click Go. You will see the services. Name the service as you like. Example MyServiceReference.
3. In Web API Controller get an instance of the proxy as MyServiceReference.MyServiceClient proxy = new MyServiceClient ()
4. Now use your proxy to call the methods in services.
Thanks for quick reply, I have WCF Service that is hosted in IIS. When I am adding in Web-APi Project. I am getting error. ( Web API refrence is not found).
Could you please Post some code snippet.
Where are you adding Web API project? in Visual Studio? or in ISS? The WCF Service does not need to know the existence of Web API project.
I assume you have an API project in visual studio. Right click reference and click ‘Add Service Reference’. In the dialog box, you will have to enter the service location. You can also check in browser if the service is indeed there.
There is no API type project in my solution. I am working in VS-13. There is one folder That contains API Controller.
That problem is solved.
I have another problem. How Window Authentication or form Authentication will done in WCF service with Web-API
I am glad that your issue has been solved.
Please post a new thread for your new issue ,for one thread just contain one topic which can help other members who have the same issue easily .and mark answer who help you.