Is it possible to host the WCF Service without SVC or Config file with MVC?
Related
is this possible to get a single WSDL file in "WCF routing service"(hosted on IIS) for all the services behind the routing service?
Using this WSDL file, All Clients can directly consume it and generate proxy class that actually point to router service rather than individual services.
Thanks.
How would I host 2 WCF services within the same web site ( i.e. same web application) ? I do not want to have each WCF with its own independent web site host.
WCF Services integration with IIS uses a .svc file for hosting in a web application.
You can create as many .svc files as services you created with WCF in the same web application, so you only need to create a .svc file for each WCF service inside your web project.
Maybe you could explain the implementation details services to know if this applies to you.
What is the difference between developing WCF service by opening a console application project(generally) and a WCF project? By creating a WCF service project, the auto generated files consist of app_data, IService1.cs , Service1.svc and web.config. What is the purpose of those files?
thanks!
a WCF service project is a web project designed to run in IIS.
The web.config file contains the configuration of the web app (and the WCF service configuration -endpoint, behaviors, bindings)
The svc file is the web resource your client will call, it associates an url (service1.svc) with a service contract.
The IService1.cs file contains the service contract interface.
there is a Service.svc.cs file too which contains the service contract implementation.
If you use WCF in a console project, you will have to start WCF yourself (ServiceHost etc...)
If you use WCF in a web application, this logic is handled by the service activation framework in IIS, using the configuration provided by web.config.
IIS activated WCF services are easier to use, but require to be hosted by the web server.
I have created a working wcf service. I have come a cross a page regarding wcf services
which describes the process for eliminating default wcf service page.
It is here https://github.com/geersch/WcfServiceMessage
Except for the things the author of this page is describing, I have one question.
How has he managed to configure the IIS or Web.config to host page with the address: http://localhost:8732/HelloWorld/ ?
At home, the only address I see my service at is: http://localhost:8732/MyServiceName.svc
(with svc extension)
How has he done it that the endpoint address: "HellowWorld" is used?
Thanks!
The WCF service endpoint is not actually a file. The total url itself is what the server recognizes as something to service, so the HelloWorld piece is just as good as HelloWorld.svc.
This is a difference between IIS hosted service and Windows or Visual Studio service host (cassini). In iis, you do have to specify a file that ends with svc and make that extension known. In iis you can also set a svc file as the default file to open if a specific directory is opened. that way you can achieve the same behavior.
I currently have a website where I'm hosting a webservice with several web methods, I need to add some new web methods, but I want to move to the WCF services model rather than continue with asmx. I want to be able to host the WCF service in the same IIS 6 website as the asmx is - is this possible and if so are there any gotchas?
You could host the WCF service in a virtual directory under the one holding the ASMX service. You will have to make the new virtual directory be an application, so it can have its own bin folder.
BTW, you distinguish "web services" from "WCF services". This is a false distinction. WCF is the replacement for the legacy ASMX technology, and can do both plain SOAP like ASMX services, or just about anything else.