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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:44:25+00:00 2026-06-12T16:44:25+00:00

I created a WCF web service and hosted it on IIS. The web.config looks

  • 0

I created a WCF web service and hosted it on IIS. The web.config looks something like this:

[...]
<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior name="[Namespace].[ServiceNameBehavior]">
                <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
                <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>

    <services>
        <service name="[Namespace].[ServiceName]" behaviorConfiguration="[NameSpace].[ServiceNameBehavior]" >
            <endpoint address="basic" binding="basicHttpBinding" contract="[Namespace].[IService]" />
            <endpoint address="secure" binding="basicHttpsBinding" contract="[Namespace].[IService]" />
        </service>
    </services>
</system.serviceModel>
[...]

When I access http://localhost/[Namespace]/[ServiceName].svc I get the usual web service web page indicating you have created a service, and that to test it you should call the service using svcutil.exe, etc, etc…

Now.. the problem is that, as defined in the web.config, I want to use two types of connections for this web service (and actually just limit the access to those two, so disabling the default .svc call) but when I go to http://localhost/[Namespace]/[ServiceName].svc/basic or https://localhost/[Namespace]/[ServiceName].svc/secure I get a blank page nor can I access the services from a local-hosted PHP page.

Is it normal that these bindings behave like this? If not, How can I fix it?

Update 1


I also noticed that trying to create references to either of these endpoints from Visual Studio results in the following error:

There was an error downloading ‘https://localhost/%5BNamespace%5D/%5BServiceName%5D.svc/secure&#8217;.
The request failed with HTTP status 400: Bad Request.
Metadata contains a reference that cannot be resolved: ‘https://localhost/%5BNamespace%5D/%5BServiceName%5D.svc/secure&#8217;.
Content Type application/soap+xml; charset=utf-8 was not supported by service https://localhost/%5BNamespace%5D/%5BServiceName%5D.svc/secure. The client and service bindings may be mismatched.
The remote server returned an error: (415) Cannot process the message because the content type ‘application/soap+xml; charset=utf-8’ was not the expected type ‘text/xml; charset=utf-8’..
If the service is defined in the current solution, try building the solution and adding the service reference again.

Adding a reference to http://localhost/%5BNamespace%5D/%5BServiceName%5D.svc works good.

  • 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-12T16:44:26+00:00Added an answer on June 12, 2026 at 4:44 pm

    It all looks like it’s working to me, you just seem to have confused the concepts of Service URL and Endpoint URL:

    • There is only one service URL per <service> element per protocol. This is used to get the test page, to add a service reference, and to get the WSDL document (via the ?wsdl query parameter).
    • There is also one endpoint URL per <endpoint> element. These are the ones ending in /basic or /secure. The only thing that these URLs will do is accept SOAP requests. You can’t get metadata from them or browse to them. There is one exception to this, you can expose a /mex endpoint using a mexHttpBinding or mexHttpsBinding which returns metadata via a SOAP request. This is entirely optional, and in your case is unnecessary, since you are exposing the WSDL via HTTP(S) GET instead.

    On the client side, in Visual Studio, you Add Service Reference using http://localhost/[Namespace]/[Service].svc. If defining client endpoints manually, you set their addresses to http://localhost/[Namespace]/[Service].svc/basic and http://localhost/[Namespace]/[Service].svc/secure respectively.

    UPDATE:

    To prevent the http://localhost/[Namespace]/[Service].svc URL from responding to requests, disable metadata publishing in the service config:

    <behaviors>
        <serviceBehaviors>
            <behavior name="[Namespace].[ServiceNameBehavior]">
                <serviceMetadata httpGetEnabled="false" httpsGetEnabled="false"/>
                <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
        </serviceBehaviors>
    </behaviors>
    

    Obviously if you do this then you can no longer add a new service reference in any client code, but that is perfectly acceptable in a production environment where you control both client and server code.

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

Sidebar

Related Questions

I created a WCF Service, Hosted it in IIS and created a web application
i am using ninject in a wcf web service.This web service is hosted in
I have created a reference to an IIS hosted WCF service in my ASP.NET
I have a WCF web service using basicHttpBinding with NTLM hosted on IIS 7
I have a .NET, WCF web service (created in PowerBuilder 12.5.1) hosted on an
I created a WCF service in Windows Azure project (with 1 WCF Service Web
I've created a web service using WCF. I cannot figure out how to set
I have created a web service via WCF. Then I exposed it as a
I have created a WCF service that needs to be hosted in a Window
I have WCF service that is IIS-hosted and I have to send binary data

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.