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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:51:36+00:00 2026-05-19T04:51:36+00:00

I am new to WCF so please bear with me. Using the latest version

  • 0

I am new to WCF so please bear with me.

Using the latest version of the WCF REST Starter kit, I created a web service that is being called by an Android application. The RESTful endpoint is working fine but I would like to create a SOAP endpoint so that a .NET client will be able to use it and generate all the necessary classes.

I am still using the default configuration file and I am a little confused about what I need to do to it.

Here it is

<?xml version="1.0"?>
<configuration>

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>

  <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </modules>
  </system.webServer>

  <system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
    <standardEndpoints>
      <webHttpEndpoint>
        <!-- 
            Configure the WCF REST service base address via the global.asax.cs file and the default endpoint 
            via the attributes on the <standardEndpoint> element below
        -->
        <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"/>
      </webHttpEndpoint>
    </standardEndpoints>
  </system.serviceModel>

</configuration>

I think I need to add the following somewhere into the config file but I am unsure where it belongs or if I am on the right path.

<endpoint name="mex" address="mex" binding="mexHttpBinding" contract="Service1"/>
<endpoint name="soap" address="soap" binding="basicHttpBinding" contract="Service1"/>

I only have one class and that is Service1.cs. I have tried to make some changes but I have had no success.

I would like to know what I have to add and an explanation of why it’s needed would be wonderful.

— Update —

After I inserted the services tag, I was having trouble getting the ‘Add Service Reference’ feature to work in visual studio. I found out that ‘HttpGetEnabled’ needs to be true, so it would publish the service metadata to http.

I added this and it seems like its working.

<behaviors>
          <serviceBehaviors>
              <behavior name="Service1Behavior">
                  <serviceMetadata httpGetEnabled="true" policyVersion="Policy15"/>
              </behavior>
          </serviceBehaviors>
      </behaviors>

If I add more services, do I have to create two more endpoints for that service too?

Thanks.

  • 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-19T04:51:36+00:00Added an answer on May 19, 2026 at 4:51 am

    If you want to expose additional endpoints on your service, you need to add those to the <service name="...."> tag in your config:

    <system.serviceModel>
      <services>
        <service name="NameSpace.ServiceClassName>
           <endpoint name="rest" 
                     address=""
                     binding="webHttpBinding"
                     contract="IService1" />
           <endpoint name="soap" 
                     address="soap"
                     binding="basicHttpBinding"
                     contract="IService1" />
           <endpoint name="mex" 
                     address="mex"
                     binding="mexHttpBinding"
                     contract="IMetadataExchange" />
        </service>
      </services>
    </system.serviceModel>
    

    You’re obviously using the WCF 4 standard endpoints being exposed – if you want to change that, you will need to explicitly spell out all your config you need.

    Now, your service (as implemented in ServiceClassName in the NameSpace namespace) will have three endpoints:

    • the base address of your *.svc file will be the REST endpoint using webHttpBinding
    • the (service.svc)/soap address will be the same contract (same service methods), but using the SOAP-based basicHttpBinding
    • the (service.svc)/mex address will have the service metadata for the SOAP clients
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a new wcf4 web application and added a new wcf service.
I've just created a new data service using the WCF Data Services 4.1 CTP2
I have developed a sample WCF REST service that accepts that creates an Order
Please tell me I'm doing something stupid in setting up my wcf rest service.
I am using WCF REST Service (4.0) to expose JSON API ..but not getting
I am new to WCF Services. We are creating a REST WCF Service which
I'm new to both WCF and threading, so please bear with me. I have
I am new to WCF. Initially I created a WCF service and used the
I have created a new WCF service library type project. I have created a
I have a Silverlight web app using WCF and Membership.CreateUser to create new users.

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.