views:

379

answers:

1

We have a windows service that we are trying to use as WCF host for a WPF application. It works fine in development but when we have tried to move to our production environment we have had nothing but problems. From reading posts from others, we figured out how to turn on WCF logging and this was a big help. It turned out that our security bindings on the service and the client did not match. We set them both to use windows security but still no luck now we are trying to set the security mode to 'None' but it still is not working. Here is the bindings section of our service config file:

<system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="netTcp">
          <security mode='None'>
          </security>
        </binding>
      </netTcpBinding >
    </bindings>
    <services>

      <service name="CompanyService">
        <endpoint
          address= "our.url.com/CompanyService"
          binding="netTcpBinding"
          contract="CompanyServices.ICompanyService" />
      </service>
    </services>
  </system.serviceModel>

Here is the serviceModel section of our client app config:

  <system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="NetTcpBinding_Config" >
          <security mode="None">
          </security>
        </binding>

      </netTcpBinding>
    </bindings>
    <client>
      <endpoint address="our.url.com/CompanyService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_Config" contract="CompanyServiceProxy.ICompanyService" name="NetTcpBinding_ICompanyService" />
    </client>
  </system.serviceModel>

If I need to supply additional infor please tell me what I need to supply.

Thanks

A: 

Standard net.tcp binding uses Windows credentials by default, and those really require client and service to be in the same Windows domain. Is this the case here??

OK, sorry, you mentioned security=None (your listings weren't properly formatted so I only saw a fraction of the actual config).

I guess your problem really lies in the addresses used:

address= "our.url.com/CompanyService"

When using net.tcp binding, you have to specify that before the address, so change this on both the client and the server to:

address= "net.tcp://our.url.com/CompanyService"

Also, what I don't quite understand is your title: it mentions "streaming" - have you specified streaming mode anywhere? In your config or your service contracts?

Marc

marc_s
Sorry I messed up the address we used when I posted the question. We are using the form "net.tcp://our.url.com/Company" in our addresses. In an attempt to get this to work we put the client app on the server that hosts the service. The server is in a domain and the user is a domain account. One thing I noticed when I made my post was the securinty mode in the service config was enclosed with single quotes but the security mode in app config was enclosed with double quotes. Could that be the problem?
We found the problem. We were not setting the BindingConfiguration attributes on the endpoints. When we added "<endpoint BindingConfiguration = "netTcp" ..." it all worked. It was just a dumb mistake.
It's most often just a silly oversight. Glad you found your problem!
marc_s