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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:55:15+00:00 2026-05-25T21:55:15+00:00

I have a WCF RESTful web service (using the webHttpBinding) running under IIS, exposed

  • 0

I have a WCF RESTful web service (using the webHttpBinding) running under IIS, exposed via an SVC file (accessed at http://projectserver/BlarghService/BlarghService.svc).

I can access service endpoints through the URI templates defined on each service by using the BlarghService.svc file, like so:

http://projectserver/BlarghService/BlarghService.svc/accounts/
http://projectserver/BlarghService/BlarghService.svc/accounts/342432

Both of these work fine.

However it’s important I remove implementation details from the URIs, so I used IIS URI rewriting module and set up a wildcard rewriting rule which tacks everything after /BlarghService/ to the end of BlarghService.svc, so the following are transformed into the earlier representations:

http://projectserver/BlarghService/accounts/
http://projectserver/BlarghService/accounts/342432

However, when I request these resources I get 404 errors. These are not IIS-generated 404 errors, but those generated by ASP.NET itself (so IIS is correctly rewriting the URL). However ASP.NET decides to check if the specified file (“BlarghService.svc/accounts/342432”) exists in the filesystem which it should be passing it on to my web service.

But the strange thing is when I copy the reported “Requested URL” (from the ASP.NET 404 error) back into the address bar, it works fine.

So what’s going on?

EDIT: Here is my web.config (located in the “BlarghService” directory)

<system.web>
    <compilation debug="true" />
    <authentication mode="None" />
    <customErrors mode="Off" />
</system.web>

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <!-- Currently ASP.NET steps in says it's a 404 error when it should be handled by BlarghService.svc, I've no idea why. -->
    <rewrite>
        <rules>
            <rule name="BlarghServiceRewriteRule" patternSyntax="Wildcard">
                <match url="*" />
                <action type="Rewrite" url="BlarghService.svc/{R:0}" />
            </rule>
        </rules>
    </rewrite>
</system.webServer>

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true">
        <baseAddressPrefixFilters>
            <add prefix="http://projectserver/BlarghService" />
        </baseAddressPrefixFilters>
    </serviceHostingEnvironment>
    <services>
        <service name="Foo.Blargh.Api.BlarghService" behaviorConfiguration="BlarghServiceBehavior">

            <endpoint name="BlarghEndpoint" address="BlarghService.svc" behaviorConfiguration="BlarghEndpointBehavior" binding="webHttpBinding" contract="RH.Blargh.Api.BlarghService" />

        </service>
    </services>
    <behaviors>
        <serviceBehaviors>
            <behavior name="BlarghServiceBehavior">
                <serviceMetadata httpGetEnabled="false" />
                <serviceDebug includeExceptionDetailInFaults="true" />
            </behavior>
        </serviceBehaviors>
        <endpointBehaviors>
            <behavior name="BlarghEndpointBehavior">
                <webHttp />
            </behavior>
        </endpointBehaviors>
    </behaviors>
</system.serviceModel>
  • 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-25T21:55:26+00:00Added an answer on May 25, 2026 at 9:55 pm

    UPDATE: It turns out that WCF can only respond on one particular HTTP host header at a time, and that my URL rewriting was involved in responding to some host headers but not others. By standardising on a single set of host-headers and reformulating my rewrite rules accordingly it started working.

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

Sidebar

Related Questions

I have a WCF web service that implements a RESTful interface. We're using the
I'm trying to consume a RESTful web service using WCF. I have no control
I have a REStful WCF web service (using a substantially modified WCF Rest Starter
I have a WCF service with multiple operations exposed as a RESTful API. Most
I have a RESTful WCF web service that processes huge XML files that are
I have a RESTful WCF web service called "Palladium" as a project in my
I have a WCF Web Api Restful webservice. I want every single service call
Im using this example as a guide: http://geekswithblogs.net/michelotti/archive/2010/08/21/restful-wcf-services-with-no-svc-file-and-no-config.aspx I've created the site by following
I have wirtten a RESTful WCF Service. Incorporating E-Tags, expires headers. The caching works
I have a RESTful service that I am developing in WCF . I am

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.