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

谁说胖子不能爱 提交于 2021-01-27 04:52:08

问题


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


回答1:


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



来源:https://stackoverflow.com/questions/13935169/how-to-create-or-attach-wcf-service-in-existing-asp-net-web-site

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!