Last post Feb 08, 2015 11:01 AM by dwneder
Feb 05, 2015 01:49 PM|dwneder|LINK
I have two solutions; a web app and a WCF 4 service. They use the same folders, databases and tables (but, obviously, different filenames).
I can publish one (the app or service) and have it run fine while breaking the other. This used to work.
Should I try to add the existing service files to the app project and publish them together or is there another/better way to accomplish this?
Feb 08, 2015 01:11 AM|Shawn - MSFT|LINK
For this scenario, you couldn't have to merge the two solutions together. For WCF service, you could just host it in the IIS server, and if you want to invoke the methods within the wcf service, you could just add the service reference into the web application.
Then also you could host the web application in your IIS server.
About How to Host a WCF Service (IIS Hosting and Self Hosting):
Feb 08, 2015 11:01 AM|dwneder|LINK
Thanks for your reply.
To solve this problem I went ahead and merged the service components and the app itself. Then, I added the service pieces to web.config and rewrote some of the calls since the used the same module subs/functions.
I did this because frankly, there is scant documentation on how things work under the hood and I didn't want to spend the next 2 weeks on a treasure hunt to find it. It's very difficult to know what the ramifications would be of the three options:
1) Maintain two separate solutions (my original choice) of the web application and the web service.
2) Add the web service project to the solution thus having only one solution with two (or more) projects.
3) Merge the two having only a single solution and a single project - my final choice.
In my scenario the site is hosted outside the office and thus, I don't have access to IIS. Therefore I couldn't use your solution.
However, for others who may read this, merging these together offered me a number of advantages that I'll outline below. Keep in mind however that while my service actually has many dozens of service calls (endpoints) they are all maintained
within just 4 primary files:
1) The interface - kept very clean and self-documenting.
2) The public-exposure of services - again, very clean, simple and self-documenting.
3) The support module for the services - where all of the service work actually gets done, called by the public-exposure systems with some common Private routines shared by many subs/functions.
4) My web application's generic subs/function calls I use throughout the rest of the application.
Here are some of the advantages I found in doing this:
1) As soon as I merged these and fixed all the calls both my web application and service started working again on both my development machine and the live site.
2) It became much easier to maintain since I didn't have to make changes in multiple places - I could keep everything in the same IDE.
3) It exposed the client services for use by my web application making it much easier to call and work with them.
4) It improved the overall organization of the site and made it much easier to find things.
5) It saved me TONS of time trying to figure all of this out, researching, waiting for answers on sites (like this one), etc.
There are a number of downsides to this as well:
1) It would be difficult for multiple coders to work on this (I'm doing this phase myself - a backend data warehousing system).
2) The developer has to separate the frontend (user-exposed) application from the backend (services/processes).
3) It requires some level of organization to keep a very large site managed. I use variable/sub/function/service naming conventions that I stick to religiously to aid this.
4) It requires that things be documented properly. I have one service-bible alone for all the service endpoints our user-interface team uses.
Keep in mind, I'm not a novice developer. I've been coding professionally for over 35 years. The problem here is that the developer has to know the history of WCF 4 AND realize that there are so many different variants - none of which are compatible. More
than once I began down a certain road in this project only to have to turn back around and redo the direction because examples on the internet and even in the documentation were not compatible with the version/technologies I'm using!
I hope this all helps someone else.