none
Server service cannot see wcf service client RRS feed

  • Question

  • I am using visual studio 2010 pro on windows 7 x86 running as administrator

    My solution contains a number of projects all of which consume the same wcf service.

    My desktop application consumes this successfully via a ServiceLibraryClient.

    This is also true for my asp.net web application.

    The wcf service is fully functional and performs without any errors.

    The problem that I am having is when I create a windows server service; which is installing and running just fine.  After adding the SereviceReference I can see and successfully use the datacontracts from the wcf service, but I cannot create a service client object because it cannot see the ServiceLibraryClient

    I am adding the service reference from within visual studio and not the command line.

    I have been trying for a very long time to try and resolve this problem and would appreciate any help.

    I have created new windows project within the solution which can all see the ServiceLibraryClient

    Thank you in advance for taking the time and trouble to consider this problem.

    • Moved by Amanda Zhu Tuesday, June 11, 2013 6:24 AM move to a more appropriate forum
    Sunday, June 9, 2013 12:14 AM

Answers

All replies

  • Your problem is one or both of the following

    1) The client is in a different dll and you have to add the 2nd dll to the prject on the server

    2) The client is in a diferent namespace and you have to add the namespace to the top of your module with a  "using" statement (c#) or an import statement (vbnet).  When you put the statement "using System.Net" are the top of your module is manes there is a namespace System.Net.


    jdweng

    Sunday, June 9, 2013 1:43 AM
  • Thanks for the suggestions.

    All of the files are currently on my Windows 7 development computer including all of the clients which can currently access the WCF service.

    I have already added the correct using <namespace> within the service.

    The same procedure was used to add the service reference to the server service as to each of the other client program which consume the WCF service. What I have notice is that there is a marked difference in the contents of the app.config files.  The server service project contains:

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    </configuration>

    and the desktop clients file contains

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
        <system.serviceModel>
            <bindings>
                <wsHttpBinding>
                    <binding name="WSHttpBinding_IDionysiaServiceLibrary" closeTimeout="00:01:00"
                        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                        bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
                        maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                        messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
                        allowCookies="false">
                        <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                        <reliableSession ordered="true" inactivityTimeout="00:10:00"
                            enabled="false" />
                        <security mode="Message">
                            <transport clientCredentialType="Windows" proxyCredentialType="None"
                                realm="" />
                            <message clientCredentialType="Windows" negotiateServiceCredential="true"
                                algorithmSuite="Default" />
                        </security>
                    </binding>
                </wsHttpBinding>
            </bindings>
            <client>
                <endpoint address="http://localhost:8080/DionysiaServiceLibrary"
                    binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IDionysiaServiceLibrary"
                    contract="DionysiaWebService.IDionysiaServiceLibrary" name="WSHttpBinding_IDionysiaServiceLibrary">
                    <identity>
                        <dns value="localhost" />
                    </identity>
                </endpoint>
            </client>
        </system.serviceModel>
    </configuration>

    I have tried copying and pasting this into the server service app.config file rebuilding and updating the wcf service reference which has no effect as I can still see the data contracts but not the methods of the WCF.

    I am open to suggestions here if you have any thoughts.

    Once again thanks in advance.

    Sunday, June 9, 2013 10:41 AM
  • I think I have a clue to the problem.  I think you have an issue with the System Service Environment.  You config file has the following : useDefaultWebProxy.  The default is coming from the IE settings for the account that is running the service.  See website below

    http://stackoverflow.com/questions/305870/accessing-environment-variables-from-windows-services

    You could also have a group policy issue.  See webpage below.  Note that is is from 2011 and you probably have this fix installed but I just wanted to point out the Group Policy could be inccorrect giving you an issue.

    http://support.microsoft.com/kb/2506591/en-US?wa=wsignin1.0


    jdweng

    Sunday, June 9, 2013 11:04 AM