none
I can access my WCF service, but others can't RRS feed

  • Question

  • I've got a WCF service I wrote, currently in VS 2010, using .NET 4.0. It is running on a Windows 2003 R2 Server. The WCF service using TCP, and since IIS on 2003 R2 Server doesn't host TCP, I've written a Windows Service to host my WCF service, on the server.

    We're writing a WPF application, which will use this WCF service. The weird thing is that in testing the WPF application, if I run it as myself, I can easily access the WCF service. However, anyone else cannot. I've even logged in as the domain Administrator, and it still doesn't work.

    Certainly the issue, somewhere, is a permissions issue. My problem is I have no idea at all where this problem is. I could use help with this, please.


    Rod

    Monday, July 1, 2013 8:39 PM

Answers

  • A common problem that causes this is a firewall on the server where you have the service deployed.  It's common to block TCP connections to most ports - check to verify that the port you're using for your service is not being blocked.

    Barring that, check your app.config to verify that you're specifying the correct ports, etc, for the host, so you know it's starting properly.


    Reed Copsey, Jr. - http://reedcopsey.com - If a post answers your question, please click Mark As Answer on that post. If you find a post helpful, please click Vote as Helpful.

    Monday, July 1, 2013 8:54 PM
  • Hi,

    I see that you have set no security over TCP, then it should work.

    When you access your wcf service with other users, do you meet any error?

    Have you tried enabling WCF trace logging? To enable that, you would add something like this to your app.config:

    <system.diagnostics>
        <sources>
            <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
                <listeners>
                    <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData= "C:\MyApp.svclog" />
                </listeners>
            </source>
        </sources>
    </system.diagnostics>

    Then attempt your connection and see if "C:\MyApp.svclog" was created, and if it shows any errors. If you have VisualStudio installed on the given machine, then the ".svclog" file should be able to be opened by just double-clicking it.

    Hope it can help you.

    Best Regards.


    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 9, 2013 2:38 AM
    Moderator

All replies

  • A common problem that causes this is a firewall on the server where you have the service deployed.  It's common to block TCP connections to most ports - check to verify that the port you're using for your service is not being blocked.

    Barring that, check your app.config to verify that you're specifying the correct ports, etc, for the host, so you know it's starting properly.


    Reed Copsey, Jr. - http://reedcopsey.com - If a post answers your question, please click Mark As Answer on that post. If you find a post helpful, please click Vote as Helpful.

    Monday, July 1, 2013 8:54 PM
  • I should add that I've run Wireshark on one of the PCs that's having the problem, logged in as any user other than myself. It shows a return code of [RST, ACK].

    Rod

    Monday, July 1, 2013 8:59 PM
  • Hi Reed,

    I don't think the firewall on the server is blocking it. I've gotten onto the server and checked the Windows Firewall; it's turned off. We have Symantec Endpoint Protection on the server, but from what I understand the firewall component of SEP on the server isn't there, so it won't interfere with it, either.

    But supposing it is a firewall issue, then why would it allow me to access it from any machine in our network, but not other users? I would think that if the firewall is blocking access, it would block it for everyone.


    Rod

    Tuesday, July 2, 2013 4:32 PM
  • I thought I would provide the relevant sections of code from the App.Config file for the WCF service. I hope that it might give some insight as to what's going wrong. Here's the netTcpBinding's section:

    <netTcpBinding>
    	<binding name="tcp_ASIService" closeTimeout="00:01:00" openTimeout="00:01:00"
    	 receiveTimeout="00:10:00" sendTimeout="00:01:00" transactionFlow="false"
    	 transferMode="Buffered" transactionProtocol="OleTransactions"
    	 hostNameComparisonMode="StrongWildcard" listenBacklog="10" maxBufferPoolSize="2147483647"
    	 maxBufferSize="2147483647" maxConnections="10" maxReceivedMessageSize="2147483647">
    		<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
    		 maxArrayLength="16384" maxBytesPerRead="2147483647" maxNameTableCharCount="16384" />
    		<reliableSession ordered="true" inactivityTimeout="00:10:00"
    		 enabled="false" />
    		<security mode="None">
    			<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
    			<message clientCredentialType="Windows" />
    		</security>
    	</binding>
    </netTcpBinding>
    

    And although I don't think this has as much to do with my problem, I'm going to provide the endpoint section also from App.Config:

    <endpoint address="net.tcp://ourserver:9000/ASIService/" binding="netTcpBinding"
     bindingConfiguration="tcp_ASIService" contract="SvrRef.IService1"
     name="tcp_ASIService" />
    


    Rod

    Tuesday, July 2, 2013 5:18 PM
  • Hi,

    I see that you have set no security over TCP, then it should work.

    When you access your wcf service with other users, do you meet any error?

    Have you tried enabling WCF trace logging? To enable that, you would add something like this to your app.config:

    <system.diagnostics>
        <sources>
            <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
                <listeners>
                    <add name="traceListener" type="System.Diagnostics.XmlWriterTraceListener" initializeData= "C:\MyApp.svclog" />
                </listeners>
            </source>
        </sources>
    </system.diagnostics>

    Then attempt your connection and see if "C:\MyApp.svclog" was created, and if it shows any errors. If you have VisualStudio installed on the given machine, then the ".svclog" file should be able to be opened by just double-clicking it.

    Hope it can help you.

    Best Regards.


    Amy Peng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, July 9, 2013 2:38 AM
    Moderator
  • When I run the app as another user, and the error occurs, I get nothing. And that's the frustrating thing about it. I'm working along and suddenly the app just closes.

    Rod

    Friday, July 12, 2013 6:42 PM