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 8232147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:44:00+00:00 2026-06-07T17:44:00+00:00

I am building a web service using WCF. This service has to support REST.

  • 0

I am building a web service using WCF. This service has to support REST.

Here is what I did so far:

I configured the app with a baseAddress, the mex endpoint and an additional endpoint which has a webhttpbinding.

Here is the service configuration:

<service name="ServiceLibrary.Service" behaviorConfiguration="myServiceBehavior">
    <endpoint 
        address="" 
        behaviorConfiguration="webHttp"
        binding="webHttpBinding" bindingConfiguration="" 
        contract="ServiceLibrary.IEvalService" >
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8732/sdata/myApp/myContract/-/"/>
      </baseAddresses>
    </host>
  </service>

And here is the behavior configuration:

 <serviceBehaviors>
    <behavior name="myServiceBehavior">
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
    <behavior>
      <serviceMetadata httpGetEnabled="true"/>
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="webHttp">
      <webHttp/>
    </behavior>
  </endpointBehaviors>

I am setting up a service contract like this:

[ServiceContract]
public interface IEvalService
{
    [OperationContract]
    [WebGet(UriTemplate = "/employees('{MDNr}:{ANNr}')")]
    Atom10ItemFormatter GetEmployeeByPK(string MDNr, string ANNr);

    [OperationContract]
    [WebGet]
    string employees(string queryString);
}

And I am handling the operation contract in a separate class:

public class Service : IEvalService
{
    public Atom10ItemFormatter GetEmployeeByPK(string MDNr, string ANNr){return Employee.GetEmployeeByPK(MDNr, ANNr);}
    public string employees(string queryString)
    {
        System.Diagnostics.Debug.WriteLine("Query: " + queryString);
        return queryString;
    }

Both methods get called after executing the GET method.

I am calling the first one like this:

http://localhost:8732/sdata/myApp/myContract/-/employees('3:37')

It works perfectly, giving me the IDs, etc.

The second one I am calling like this:

http://localhost:8732/sdata/myApp/myContract/-/employees?where=name eq 'bla'

And here is where the trouble starts. The Method employees is getting called, but it receives no string. And I don’t know why. This is exactly the same code, like in those tutorials, I just changed the names…

Does anyone see the mistake I obviously made? I would really appreciate any help.

One more thing: I am working with .Net 4.0 and am running this over the debugger so I can call the urls via firefox rest client? This is a service library project.

  • 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-06-07T17:44:03+00:00Added an answer on June 7, 2026 at 5:44 pm

    Try to change the parameter’s name:

    string employees(string **where**);
    

    or change the url:

    http://localhost:8732/sdata/myApp/myContract/-/employees?**queryString**=name eq 'bla'
    

    Answer to your comment:

    1. Make a single parameter named ‘query’ and then parse its value. In this case you are responsible for parsing the query from string to real query and execute it.
    2. Check the ‘WCF Data Services‘. It may help you querying data using URL.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on building a web service (using c#) and this web service
I am building a Web service using WCF as a way to provide access
I'm building a web service client using vb .net. The web service is secured
I am building a RESTful web service in java using JAX-RS and jersey and
I'm building a restful web-service based on Spring. I'm using Spring Security. It will
A Guide to Designing and Building RESTful Web Services with WCF 3.5 , this
I'm building a web api using WCF web api preview 6, currently I'm stuck
I'm interested in properly handling Faults within a WCF REST Service client. While using
I will have a client application using a proxy to a WCF Service. This
I am building a web service using the Zend Framework. I am using the

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.