Take the 2-minute tour ×

Debugging WCF - and for the life of me I cannot figure out why my service method is returning http error 400. The DLL is deployed in IIS and the SVC points to it - all of the other service methods in the DLL are available and return the correct data. I have the debugger attached in the process in IIS, and I am able to step through all of the other service methods - but for some reason the debugger doesn't even catch calls to this method. Symbols are loaded correctly. I even tried breaking on all exceptions - it does not want to stop in GetCustomInquiries_POST for any reason, and the service is still available and shows http error 400 on return. Any ideas? I know I fat fingered it somewhere.

I have a service with the following contract:

    [WebInvoke(BodyStyle = WebMessageBodyStyle.Wrapped, ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json)]
    Stream GetCustomInquiries_POST();

And the following implementation:

    public Stream GetCustomInquiries_POST()
        // Returns a list of of business objects
        CustomInquiries customInquiries = WebSupport.DocumentInquiry.GetCustomInquiries();

        // Create an empty list of WCFCustomInquiry, which is a data
        // contract that exposes certain properties of a customInquiry.  
        // This list will be filled with all of the saved inquiries
        List<WCFCustomInquiry> customInquiriesToReturn = new List<WCFCustomInquiry>();

        // For each of the inquiries that were returned.
        foreach (CustomInquiry customInquiry in customInquiries)

            // Create a list of properties exposed via the web service
            List<WCFProperty> savedProperties = new List<WCFProperty>();

            // For each of the properties in the saved inquiry, cast it to a WCFProperty, 
            // which is added to the list of properties exposed to the web service
            foreach (InquiryPropertyValue testProperty in customInquiry.SearchCriteria.Properties.Values)
                WCFProperty savedProperty = new WCFProperty(testProperty.PropertyID, testProperty.Prompt, testProperty.DataType);
                savedProperty.inquirySearchText = testProperty.Value.ToString();
                savedProperty.inquirySearchType = testProperty.SearchType;

            // create a new webInquiryCriteria instance, which exposes the listed
            // properties to the web service.
            WCFInquiryCriteria webInquiryCriteria = new WCFInquiryCriteria(customInquiry.TopLevelFolders, customInquiry.DocTypes, customInquiry.SearchCriteria.DocumentTypes, customInquiry.SearchCriteria.TopLevelFolders, savedProperties, "", "", false, null, null);

            // Created an instance of the data-contract, using the members
            // to be exposed from the inquiry
            WCFCustomInquiry customInquiryToReturn = new WCFCustomInquiry(customInquiry.CustomInquiryId, customInquiry.Name, customInquiry.Description, customInquiry.AutoRun, customInquiry.DocTypes, customInquiry.TopLevelFolders, webInquiryCriteria, customInquiry.UserSuppliedProperties);

            // Add that new instance to the list that 

        return WebSupport.JSONSerializationHelper.GetJSONStreamToReturn(customInquiriesToReturn);
share|improve this question
How do you call this method? –  marceln Jun 19 '12 at 18:13
Via REST - HTTP POST - I can write an ajax method but for testing I normally use XHR Poster for chrome. So I can post to… and I get error 400 - but if I post to I get a json list of items as expected. –  Warren J Thompson Jun 19 '12 at 18:20
add comment

Your Answer



Browse other questions tagged or ask your own question.