简体   繁体   中英

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

I have a web application that contains a WCF library. The web app runs on port 64697, the WCF runs on port 50128. When testing by running thru VS 2010 I am able to go to the localhost:50128/eshop.svc and see the svc page. What do I need to do to publish the project to an IIS dev server? IIS is set up to run WCF as I have put a test service on it and can access the wsdl. I have a eshopServive.svc in the wcf library. The library name is "company.EShop.WCF"

Thanks

Web config snippet

<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>

I typically compile the service to a DLL, then GAC it on the server. Make sure your .svc file under IIS references the GAC'd DLL like this:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM