Reputation: 34632
I am having some difficulty in deploying my WCF service alongside my ASP.NET web application. I have everything working on my local machine (defined my address, bindings, contract) and I can call the service from my ASP.NET (MVC) web application. (Base URL right now is http://localhost:####/Design_Time_Address/Fully/Qualified/Service/)
Unfortunately, once I attempt to deploy, things tend to blow up.
Here is what I currently am doing. Please let me know if one or more steps are incorrect.
Like I said, I was good until I had to deploy and, unfortunately, I am unable to find any tutorials that can help me out.
What am I not understanding is what setup I need to do to be able to access my service via my MVC application through the host server? Do I need to provide the service reference in my MVC project as I'm doing now? Do I have to configure something in the WCF service directly? Is it possible just to do web deploy and Stuff Just Works(TM)?
Appreciate your help.
Upvotes: 1
Views: 8433
Reputation: 34632
So, it turns out the problem was very easily solved...unfortunately, in this case, I was a complete noob. Instead of creating a WCF Service Application, I had created a WCF Service Library. Switched to a WCF Service Application, set up my end points, added the DEPLOYED service to my MVC application, and it worked like a charm.
Feeling like a newbie today...
Upvotes: 0
Reputation: 1038710
You could go by small steps.
http://host/myservice/service1.svc
).<system.serviceModel>
section containing a client endpoint whose address is pointing to the WCF service you have publishedNow that you have setup everything you are ready to start implementing functionality into the service. You could either then test the service locally by changing the client endpoint in the web.config file of your ASP.NET MVC 3 application or leaving it and publishing the service.
Personally I don't use the Add Service Reference
dialog in Visual Studio. I hate it when it touches to my web.config. I just hate when something touches to my code without my permission or verification. I use the command line svcutil.exe to generate a strongly typed client for my WCF services. So I type the svcutil.exe http://localhost:1234/service1.svc
command which generates 2 files: a .cs file containing the client proxy and an app.config file containing the service endpoint configuration (which I usually throw away as I prefer to modify the web.config of my application manually). Then I copy the .cs file to my client application.
Upvotes: 1