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

  • Home
  • SEARCH
  • 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 6758327
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:46:22+00:00 2026-05-26T13:46:22+00:00

I have a WCF service with custom binding, hosted in IIS (IIS Express in

  • 0

I have a WCF service with custom binding, hosted in IIS (IIS Express in development) with following service contract:

[ServiceContract]
public interface IServer
{
    [OperationContract]
    StreamCollection GetStreams(Guid poolKey);

    [OperationContract]
    PoolCollection GetPools();

    [OperationContract]
    StreamEntity GetStream(Guid poolKey, string localIndex);    
}

It works OK (from client and also I can see it’s metadata discovered ok in WCFTestClient).
I have to expose its functionality as REST, so I created a new contract as below

[ServiceContract]
public interface IRestServer
{
    [OperationContract(Name="GetStreamsREST")]
    [WebGet(UriTemplate = "pool/{poolKey}/streams")]
    StreamCollection GetStreams(string poolKey);

    [OperationContract(Name = "GetPoolsREST")]
    [WebGet(UriTemplate = "pools")]
    PoolCollection GetPools();

    [OperationContract(Name = "GetStreamREST")]
    [WebGet(UriTemplate = "pool/{poolKey}/stream/{localIndex}")]
    StreamEntity GetStream(string poolKey, string localIndex);
}

I have both interfaces implemented in the same service class.
The web.config file is

<behaviors>
  <endpointBehaviors>
    <behavior name="webHttp">
      <webHttp/>
    </behavior>
  </endpointBehaviors>
</behaviors>
<bindings>
  <customBinding>
    <binding name="CustomBinding">
      <binaryMessageEncoding />
      <httpTransport maxReceivedMessageSize="655360" />
    </binding>
  </customBinding>
</bindings>
<services>
  <service behaviorConfiguration="ServiceBehavior" name="MyServ.Server.Server">
    <endpoint address="" binding="customBinding" bindingConfiguration="CustomBinding" contract="MyServ.Server.IServer" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
    <endpoint address="rest" behaviorConfiguration="webHttp" binding="webHttpBinding" contract="MyServ.Server.IRestServer" />
  </service>
</services>

However, when I browse to access the service using rest, witha url like

http://localhost:<myport>/Service.svc/pools 
http://localhost:<myport>/Service.svc/pool/somekey/streams
http://localhost:<myport>/Service.svc/pool/somekey/streams

I get error 404.

I put a break-point in some methods and attached debugger to IIS process, but it seems nothing gets called.

If I check the service metadata with WCFTestClient, it just sees IService, but not IRestService. Is this normal? EDIT: Yes, it seems it is (check this)

Thanks for any suggestion.

  • 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-26T13:46:23+00:00Added an answer on May 26, 2026 at 1:46 pm

    Thanks all for all suggestions.
    However, I solved the issue finally.

    The problem is I don’t know still what was the problem, but I decided to take a different and more “clean” way.

    So what I did was to create a different service SVC file, RestServer, where I implemented the REST methods

    And I modified the settings in web config to have two different services, one for original one (pure WCF) and one for REST one, as below

    <service name="MyServ.Server.RestServer" >
        <endpoint address="" name="RESTEndpoint" behaviorConfiguration="webHttp" binding="webHttpBinding" contract="MyServ.Server.IRestServer" />
    </service> 
    

    And this did the trick.

    Actually, I should use this approach from the very beginning, to comply with single responsability principle …

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

Sidebar

Related Questions

I have a WCF service for which I have specified custom binding/readerQuotas settings. However,
I have a WCF service which is hosted in IIS 7.0/7.5 inside of a
I have a WCF service that needs to expose a custom collection to it's
In my WCF service I have implemented a custom encoder which inherits from System.ServiceModel.Channels.MessageEncoder
I have a custom ServiceAuthorizationManager implemented in wcf webhttp service to do api key
here's the setup for the project. I have a WCF Service that is hosted
I have created an AJAX-enabled WCF service to return a List<> of a custom
I have a WCF service and a client, that uses a custom UserNamePasswordValidator for
We currently have a situation where we have a WCF service which generates custom
I have a WCF service with a custom IServiceBehavior attached used to return a

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.