locked
Error when hosting service in IIS7.0 using net.tcp RRS feed

  • Question

  • I have a service that is exposing three contracts.  They are all in the same DLL and I need to increase  the maxMessageReceived on the binding configuration.  
    Here is the config


          <bindings>
            <netTcpBinding>
              <binding name="NewBinding0" closeTimeout="00:01:00" receiveTimeout="00:01:59"
                sendTimeout="00:01:00" listenBacklog="100" maxBufferPoolSize="2147483647"
                maxBufferSize="2147483647" maxConnections="100" maxReceivedMessageSize="2147483647"
                portSharingEnabled="true">
                <security mode="Transport" />
                <readerQuotas maxArrayLength="2147483647" maxDepth="2147483647" maxStringContentLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
              </binding>
            </netTcpBinding>
          </bindings>
          <services>
            <service behaviorConfiguration="YMessageService.MyMessageRouterBehavior"
              name="MyMessageService.MyMessageRouter">
              <endpoint address="/Subscribe" binding="netTcpBinding" bindingConfiguration="NewBinding0"
                contract="MyMessageService.ISubscribe" >
                <identity>
                  <servicePrincipalName value="localhost" />
                </identity>
              </endpoint>
              <endpoint address="/Publish" binding="netTcpBinding" bindingConfiguration="NewBinding0" 
                contract="MyMessageService.IPublish" >
                <identity>
                  <servicePrincipalName value="localhost" />
                </identity>
              </endpoint>
              <endpoint address="/PingCheck" binding="netTcpBinding" bindingConfiguration="NewBinding0"
                contract="MyMessageService.IPingCheck" >
                <identity>
                  <servicePrincipalName value="localhost" />
                </identity>
              </endpoint>
              <endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange"  bindingConfiguration=""  />
              <host>
                <baseAddresses>
                  <add baseAddress="net.tcp://localhost/MessageService/MyMessageService.svc" />
                  <add baseAddress="http://localhost:8000" />
                </baseAddresses>
              </host>
            </service>
          </services>
    <behaviors>
            <serviceBehaviors>
              <behavior name="KcmMessageService.KcmMessageRouterBehavior">
                <serviceMetadata httpGetEnabled="true" />
                <serviceDebug includeExceptionDetailInFaults="true" />
                <serviceThrottling maxConcurrentCalls="100" maxConcurrentSessions="100"
                  maxConcurrentInstances="100" />
                <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
                <serviceTimeouts transactionTimeout="00:10:00"/>
              </behavior>
            </serviceBehaviors>
          </behaviors>


    The problem is when I make a reference to the bindingConfiguration NewBinding0 on the endpoints I get the error:

    There is no compatible TransportManager found for URI 'net.tcp://v-myserver.mydomain.com/MessageService/MyMessageService.svc/mex'. This may be because that you have used an absolute address which points outside of the virtual application, or the binding settings of the endpoint do not match those that have been set by other services or endpoints. Note that all bindings for the same protocol should have same settings in the same application.


    I cannot put the bindingConfiguration on the mex endpoint so how do Iget rid of this error or is there an easier way to increase the maxMessageReceived value for the endpoints?

    Thanks in advance

    needbrew
    Wednesday, April 8, 2009 5:31 PM

Answers

All replies

  • Does anyone know how to fix this?  If I take the bindingConifguration out of the endpoint the service works, but cannot receive the large message that it needs.  If I put the binding back it give the error. 
    needbrew
    Thursday, April 9, 2009 1:31 PM
  • Hi needbrew

    You have wcf servcie in your web.config. You need to configrue the three wcf services with three separate behavior for all the three services. It mainly depend on kind of data that you are sending from service to client and viceversa.


    regards,
    phijo mathew philip.
    PHIJO MP
    Thursday, April 9, 2009 7:36 PM
  • You do not need to apply 'bindingConfiguration' to 'mex' endpoint.

    you will be using modified bindingConfiguration for that endpoint on which u will be calling operations.

    In short, do not use bindingConfiguration attribute with mex endpoint.

    For large message receive, try using <httpruntime/> element in <system.web> element.



    ----------------
    Adam Raheem

    TS : .NET Framework 2.0
    MCTS : BizTalk Server 2006

    • Proposed as answer by Raheem Abdur Friday, April 10, 2009 11:28 AM
    • Unproposed as answer by needbrew Monday, April 13, 2009 5:20 PM
    Friday, April 10, 2009 11:27 AM
  • Hi needbrew,

    Make sure that the default website is enabled to accept net.tcp protocol.
    Makse sure that the web application is enable to accept the   net.tcp protocol.
    Also ensure the that window services required for WAS hosting are properly running.

    Regards,
    Phijo Philip
    PHIJO MP
    Friday, April 10, 2009 11:35 AM
  • Hi All,

    the service works fine being hosted in IIS 7.0 using net.tcp as long as the message size is small.  AS soon as it gets large I need to set the maxReceivedMessageSize to a larger number which is part of the binding configuration.  When I make a reference to the binding configuration below to set this I get the error 

    There is no compatible TransportManager found for URI 'net.tcp://v-kcmweb01.tjmbrokerage.com/MessageService/KcmMessageService.svc/mex'. This may be because that you have used an absolute address which points outside of the virtual application, or the binding settings of the endpoint do not match those that have been set by other services or endpoints. Note that all bindings for the same protocol should have same settings in the same application.


            <netTcpBinding>
              <binding name="NewBinding0" closeTimeout="00:11:00" receiveTimeout="23:59:59"
                sendTimeout="00:11:00" listenBacklog="100" maxBufferPoolSize="2147483647"
                maxBufferSize="2147483647" maxConnections="100" maxReceivedMessageSize="2147483647"
                portSharingEnabled="true">
                <security mode="Transport" />
                <readerQuotas maxArrayLength="2147483647" maxDepth="2147483647" maxStringContentLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
              </binding>
            </netTcpBinding>

    It is complaining about the mex endpoint but you cannot put a binding configuration on this.  I have tried setting up 3 bindings and referencing one in each end point but this does not work either.   

    needbrew
    Monday, April 13, 2009 1:06 PM
  • I should also mention that if I host this in a console application and use an app.config that is exactly the same as the web config for the service and make a reference to the binding configuration it works fine.  How do I set the maxmessagereceived on the service which is hosting 3 contracts?
    needbrew
    Monday, April 13, 2009 1:24 PM
  • Does anyone have anything on this.  If not a may have to run this as just a service instead of hosting in IIS 7.0.
    needbrew
    Wednesday, April 15, 2009 5:42 PM
  • If you're using port sharing, you need to make sure that all the bindings listening on the shared port in your service are using compatible configurations, see: http://blogs.msdn.com/drnick/archive/2006/08/23/713297.aspx


    For information on configuring a custom MEX binding, see: http://msdn.microsoft.com/en-us/library/ms734656.aspx
    Thursday, April 16, 2009 12:34 AM
  • Thanks you, the port sharing was the issue.  It turns out that to do this via the config you should not use the mexTcpBinding.  just change the binding to netTcpBinding and it works fine.

    Thanks

    needbrew
    Thursday, April 16, 2009 12:34 PM
  • HI,

    I faced this error recently. I had configured WAS, had set the site bindings at the site level for tcp, adn Enabled the net.tcp protocol at the service level in IS 7.5. In my application I had 4 endpoints. 2 mex endpoints http and tcp and 2 service endpoints again for http and tcp. For http I had base address but for the tcp I had given absolute address in the endpoint itself. When I published to IIS and ran the service then I got the same error. I created a base address for the tcp endpoints as well and then it worked fine. I could access the service metadata as well as the service on the tcp addresses.


    Arpan
    Monday, February 7, 2011 8:39 AM
  • Thanks Phijo!   In my case the web application had net.tcp enabled but the default website didn't have it enabled.   When I enabled net.tcp on the default website as well, the error went away.

     

    Tuesday, June 14, 2011 3:12 PM