簡體   English   中英

將帶有WCF庫的Web應用程序從Visual Studio開發人員移至IIS

[英]Move web application with WCF library from Visual Studio dev to IIS

我有一個包含WCF庫的Web應用程序。 Web應用程序在端口64697上運行,WCF在端口50128上運行。通過通過VS 2010運行測試時,我可以轉到localhost:50128 / eshop.svc並查看svc頁面。 將項目發布到IIS開發服務器需要做什么? 將IIS設置為運行WCF,因為我已經在其上放置了測試服務,並且可以訪問wsdl。 我在wcf庫中有一個eshopServive.svc。 庫名稱為“ company.EShop.WCF”

謝謝

Web配置片段

<services>
      <!-- Note: the service name must match the configuration name for the service implementation. -->
      <service name="company.eShop.Wcf.eShopWCFService"
               behaviorConfiguration="MyServiceTypeBehaviors" >
        <endpoint address="" binding="basicHttpBinding"
                  contract="Nad.CheckoutVendor.Interfaces.ICheckoutVendorService">
          <identity>
            <dns value="localhost"/>
          </identity>
        </endpoint>
        <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex" />
      </service>
   </services>
 <bindings>
     <basicHttpBinding>
       <binding name="BasicHttpBinding_ICheckoutVendorService" closeTimeout="00:01:00"
         openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
         allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
         maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
      messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
      useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
           <transport clientCredentialType="None" proxyCredentialType="None"
          realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
         </security>
       </binding>
     </basicHttpBinding>
   </bindings>

我通常將服務編譯為DLL,然后在服務器上對其進行GAC。 確保IIS下的.svc文件像這樣引用GAC的DLL:

<%@ Assembly Name="DLLName, Version=1.1.0.0, Culture=neutral, PublicKeyToken=YOURKEY" %>
<%@ ServiceHost Service="DLLNAME.CLASSNAME" %>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM