Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create or attach WCF service in existing asp.net web site

i have already a web site which is live and hosted in ORCS Web developed using asp.net form project type. now i am planning to develop a wcf service which will be stored in a new folder of my existing website. we will use wcf service for uploading file from client machine to our web server. client can be any other .net based web apps or .net based win apps. i never work with wcf in production environment. so i want to know can i create that wcf service which will be stored in a new folder of my web site or do i need to host that wcf service separately.

if i can store the wcf service in my existing web site then how to deploy it? if i copy the dll file of my site and svc in our web server after development and testing then it would be sufficient or not for creating proxy from client side. actually any how i have to create wcf service in my site. i can not deploy the wcf service separately out of my website. so guide me how to deploy and what are the files i need to copy to my web server because first time i will be going to do this. thanks

like image 731
Thomas Avatar asked Dec 18 '12 14:12

Thomas


1 Answers

You can add wcf service to existing asp.net application. Open solution explorer right click on asp.net app project and select "Add" -> "New Item" and then select "WCF Service".

VS will modify your web.config by adding something similar to this, wcf server configuration:

  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>

And now about deploying solution. It's never a good idea to do partial deploy. Please read one of my posts about this subject What files to upload when making a change in a webpage

like image 178
Gregor Primar Avatar answered Oct 12 '22 02:10

Gregor Primar