Search code examples
wcfwcf-client

Are there known limitations with the WCF Test Client app?


This has happened a couple of times to me know. If I add to many OperationContract's to a ServiceContract, the WCF Test Client app throws an exception:

"Failed to add a service. Service metadata may not be accessible. Make sure your service is running and exposing metadata."

In the details it continues:

Error: Cannot obtain Metadata from . The request failed with HTTP status 400: Bad Request.

If I remove a couple of operation contracts then everything is fine. Outside of the test client is also fine.


Solution

  • Thanks for the responses.

    These were the offending lines:

    <OperationContract(), FaultContract(GetType(WcfService.Common.DefaultFaultContract))> _
    Function GetJobSubTypesForJobTypeList(ByVal jobTypeList As Dictionary(Of Integer, String)) As List(Of JobSubTypeOfJobTypeDTO)
    
    <OperationContract(), FaultContract(GetType(WcfService.Common.DefaultFaultContract))> _
    Function GetActivityTypesForJobTypeList(ByVal jobTypeList As Dictionary(Of Integer, String)) As List(Of ActivityTypeOfJobTypeDTO)
    

    It turned out that we were missing setters in the return types (DTO) and a default constructor.