Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3783466
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:13:43+00:00 2026-05-19T11:13:43+00:00

I have a simple WCF service defined by the following ServiceContract: [ServiceContract] public interface

  • 0

I have a simple WCF service defined by the following ServiceContract:

[ServiceContract]
public interface IInventoryService
{
  [OperationContract]      
  Item GetItemFromBarcode(string barcode);

  [OperationContract]
  string Test(string testString);
}

With Item defined like this:

[DataContract]
public class Item
{
  [DataMember]
  public virtual int Id { get; set; }

  <Snip>
}

And the actual service implemented thusly:

public class InventoryService : IInventoryService
{
  [WebGet(UriTemplate = "/Barcode/{barcode}/Item", ResponseFormat = WebMessageFormat.Json)]
  public Item GetItemFromBarcode(string barcode)
  {
     var item = (from b in repository.Query<ItemBarcode>()
             where b.BarcodeData == barcode
             select b.Item).FirstOrDefault();
     return item;

  }

  [WebGet(UriTemplate = "/Test/{testString}",ResponseFormat=WebMessageFormat.Xml)]
  public string Test(string testString)
  {
     return testString;
  }
}

With the following in the app.config for the program hosting the service:

<system.serviceModel>      
  <behaviors>
     <serviceBehaviors>
        <behavior>
           <serviceMetadata httpGetEnabled="true"/>
        </behavior>
     </serviceBehaviors>
     <endpointBehaviors>
        <behavior name="RESTFriendly">
           <webHttp />
        </behavior>
     </endpointBehaviors>
  </behaviors>
  <services>
     <service name="InventoryService">            
        <endpoint address="/Inventory" behaviorConfiguration="RESTFriendly" binding="webHttpBinding" contract="IInventoryService"/>
        <host>
           <baseAddresses>
              <add baseAddress="http://localhost:8080/"/>
           </baseAddresses>
        </host>
     </service>
  </services>
</system.serviceModel>

Now that the code dump is out of the way, the issue: I can invoke the Test method just fine with curl or Fiddler, it returns a serialized string. However, invoking the method that returns an object returns nothing. Curl spits back curl: (56) Failure when receiving data from the peer and Fiddler responds ReadResponse() failed: The server did not return a response for this request.

From what I read, this should Just Work ™. Is there something obvious I’m missing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:13:44+00:00Added an answer on May 19, 2026 at 11:13 am

    So, it seems you can’t have DataMember of an interface type, like the IList<ItemBarcode>. There go my hopes of using my NHibernate model objects as DTOs.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple WCF service: public Order[] GetOrdersByStatus(int statusid) { OrderService os =
I have a simple WCF service that carries out a simple operation: [OperationContract] DoSomething
I have a very simple WCF REST Service [ServiceContract] [AspNetCompatibilityRequirements( RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] [ServiceBehavior(InstanceContextMode
I have created a simple WCF service by following a MSDN tutorial. I successfully
I have created a simple wcf service which used the WCF Service Library template.
I have a simple WCF Web service. It's hosted on IIS under the default
I have written a simple WCF service that accepts and stores messages. It works
I have written a very simple WCF service, that worked fine (code below), then
I have a simple WCF Data Services service and I want to expose a
i have a simple xml file in a wcf service that i am trying

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.