locked
Client application cannot discover services that WcfTestClient.exe can RRS feed

  • Question

  • Hello everybody,

    I have been experimenting with the Document Approval Process sample (http://msdn.microsoft.com/en-us/library/dd807513.aspx). I have modified it to run between two machines in our network: one hosting the ApprovalManager element and the other one running the ApprovalClient one. This scenario works fine.

    Then I tried the same approach to have a server in our data center host the ApprovalManager element. I adapted the code to the proper machine names and did the corresponding URL reservations for both services in the server (netsh http add urlacl). In this case, however, the client, running in a PC in our network, will not discover the services.

    At first, I thought it was a firewall issue. Then I ran a test with the WCF Test Client (WcfTestClient.exe) and it turns out that it did discover both services running in the server. I was also able to successfully call the services' methods. Also, both services will show "up and running" when opening their URLs from IE.

    This really puzzles me. Why the ApprovalClient element will not even discover the services, whereas WcfTestClient.exe will correctly discover and call them from the same PC?

    Should you need me to publish code or logs, just let me know. Thanks in advance for any help.

    Best regards.

    Friday, November 25, 2011 5:55 PM

Answers

  • Hi,

    The WCF discovery using the WS-Discovery protocol, it depends on the ability of discoverable WCF service send announcement messages as well as listen for and respond to discovery requests. In this sample, it use Ad-Hoc mode to discover WCF service. With Ad-Hoc mode, all discovery messages such as service announcements and client requests are sent in a multicast fashion. It is probably that the messages is unreachable between the two machines in your network. WcfTestClient.exe call the WCF service directly, hence it works properly.

    In this case, you can build a custom discovery service to fit your requirement. You can refer to the Discovery Proxy sample:

    http://msdn.microsoft.com/en-us/library/dd807497.aspx

    Thanks.


    Leo Tang [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    • Marked as answer by Felpudo Tuesday, November 29, 2011 3:50 PM
    Tuesday, November 29, 2011 11:04 AM