views:

3190

answers:

2

Hello !!

I have a wcf service where i have to implement the call backs and also i need to host the wcf service on the IIS 6.0, since IIS6.0 doesnot support the net.tcp binding, i decided to go for the custom binding. The reasons for going for custom binding is that the service is accessed by different clients in different timezones. Using custom binding i can set the allowed clock skew time to other values other than the default one.

I have problem making the custom binding work for me. here is the server config file



<services>
  <service name="SchneiderElectric.PSCNet.Server.Services.PSCNetWCFService" behaviorConfiguration="Behaviors1">
    <host>
      <baseAddresses>
        <add baseAddress ="http://10.155.18.18:2000/PSCNet"/&gt;
      </baseAddresses>
    </host>
    <endpoint address="" binding="customBinding"    bindingConfiguration="pscNetBinding"
        contract="SchneiderElectric.PSCNet.Server.Contracts.IPSCNetWCFService"/>
  </service>
</services>    
<behaviors>
  <serviceBehaviors>
    <behavior name="Behaviors1">
      <serviceMetadata httpGetEnabled = "true"/>
      <!--<serviceThrottling maxConcurrentCalls="2048" maxConcurrentSessions="2048" maxConcurrentInstances="2048" />
      <dataContractSerializer maxItemsInObjectGraph="2147483647" />-->
    </behavior>
  </serviceBehaviors>
</behaviors>

and here the client config file



if i use the server and client on the same machine everything works fine. But as soon as i run the server and client on different machine i get the following error

"Could not connect to http://10.155.18.198:9000/e60ba5b3-f979-4922-b9f8-c820caaa04c2. TCP error code 10060: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 10.155.18.198:9000."

Can anyone in the community help me in this regard.

A: 

Can you show the part of the config where you're defining the customBinding? Maybe you just didn't paste that part in, but when you define a custom binding, you have to specify an encoding and a transport at minimum - something like this:

<bindings>
    <customBinding>
        <binding name="MyCustomTextTcpBinding">
            <textMessageEncoding />
            <tcpTransport />
        </binding>
    </customBinding>
</bindings>

Can you also paste in the part where you're defining your "pscNetBinding" bindingConfiguration?

Andy White
Thanks for the response i had changed my binding to net.tcp binding and everything works well. I am planning to host it on widnows service. Do you think is it good to host on windows service provided that my service is only used for login validation and Autocad generation at the servce.
Yeah, I would think a windows service would be fine. If you have IIS 6.0, you can't really host a nettcp service anyway. In IIS 7, you can host nettcp using WAS, but if it was me, I'd just do a windows service. Here's a good article: http://msdn.microsoft.com/en-us/library/ms730158.aspx
Andy White
Thanks for the article, i just wanted to be sure that what i am doing is right by hosting on windows service. Since it is deployed in production server, do you see any disadvantage in using windows service ?
We host of a lot of our WCF services as Windows Services. It's been working fine for us, especially for non-HTTP services.
Andy White
A: 

Windows service is undoubtely a nice solution but i think a better would be a self hosting and you could have anytype of binding on it.