locked
Hosting WF4 Services in IIS7 with net TCP binding RRS feed

  • Question

  • I have a few WCF Workflow Service (.xamlx) i have deployed these in IIS 7 and these are working properly on http binding. No i want to expos these services on net.tcp binding as well. What i have done is:

    1. http version is running on port 4040
    2. Added net.tcp in my website's enabled protocols property i.e. "http,net.tcp"
    3. Added net.tcp binding with "4041:*" as binding information.
    4. modified web.config with net.tcp binding information (for 1 service having IService as service contract) as given below 
    <system.serviceModel>
    
      <services>
    
      	<service name="UpdateContactSvc">
    
    	  <endpoint name="endpoint1" address="" bindingConfiguration="" binding="netTcpBinding" contract="IService" />
    
    		<endpoint address="mex"
    
         binding="mexTcpBinding"
    
         contract="IMetadataExchange" />
    
    	  <host>
    
       		<baseAddresses>
    
    	   <add baseAddress="net.tcp://localhost:4041/CustomServices/" />
    
       		</baseAddresses>
    
    	  </host>
    
      	</service>
    
      </services>
    
    	 <bindings>
    
    		 <basicHttpBinding>
    
    			 <binding maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
    
    				 <readerQuotas maxDepth="32" maxStringContentLength="2147483647" maxArrayLength="163840000"
    
    					maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    
    			 </binding>
    
    		 </basicHttpBinding>
    
    	 </bindings>
    
    	 <client>
    
    	 </client>
    
     <behaviors>
    
      <serviceBehaviors>
    
      <behavior>
    
       <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
    
       <serviceMetadata httpGetEnabled="true"/>
    
       <!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
    
       <serviceDebug includeExceptionDetailInFaults="true"/>
    
      </behavior>
    
      </serviceBehaviors>
    
     </behaviors>
    
     <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
    
    </system.serviceModel>
    
    
    But i cannot access this service. Is there anything wrong in config file or I m missing something else?
    Farrukh
    Thursday, October 7, 2010 12:26 PM

Answers

  • Patrick,

    Thanks for you reply, but I was able to do this in IIS. I just removed services tag from my config file and my application was accessible from both HTTP and TCP end points. Rest of the configuration mentioned in my first post was un-changed.


    Farrukh
    • Marked as answer by Farrukh Ijaz Friday, October 8, 2010 7:56 AM
    Friday, October 8, 2010 7:52 AM

All replies

  • IIS is dependent on HTTP, and can't expose services that use other protocols. If you want to expose a service on the TCP protocol instead, you'll need to host in WAS or AppFabric.

    Here's an example of a service hosted in WAS (Windows Process Activation Service):

    http://msdn.microsoft.com/en-us/library/ms752218.aspx

    Thursday, October 7, 2010 4:55 PM
  • Patrick,

    Thanks for you reply, but I was able to do this in IIS. I just removed services tag from my config file and my application was accessible from both HTTP and TCP end points. Rest of the configuration mentioned in my first post was un-changed.


    Farrukh
    • Marked as answer by Farrukh Ijaz Friday, October 8, 2010 7:56 AM
    Friday, October 8, 2010 7:52 AM