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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T09:54:37+00:00 2026-05-30T09:54:37+00:00

I have a WCF REST service. I verified Webconfig file and all config items

  • 0

I have a WCF REST service. I verified Webconfig file and all config items are fine.

I am getting EndPoint not found error with below code. I will add parameters to GetDateTime method.

[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)] 
    string GetDateTime();    

NO Endpoint error with below code.

[OperationContract]
[WebGet(UriTemplate = "/")]
string GetDateTime();    

I want to get this running with WebInvoke. Any help is appreciated!

Here is the config details from Web.config file.

  <system.web>
    <compilation debug="true" targetFramework="4.0" />
  </system.web>
  <system.serviceModel>
    <services>
      <service name="SampleRest.Service1" behaviorConfiguration ="ServiceBehaviour">
        <endpoint address="" binding ="webHttpBinding" contract="SampleRest.IService1" behaviorConfiguration ="web" >
        </endpoint>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior  name="ServiceBehaviour">
          <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="true"/>
          <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
          <serviceDebug includeExceptionDetailInFaults="false"/>
        </behavior>
      </serviceBehaviors>
      <endpointBehaviors>
        <behavior name="web">
          <webHttp/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
  </system.serviceModel>
 <system.webServer>
    <modules runAllManagedModulesForAllRequests="true"/>
  </system.webServer>

Here is the URL that I tried.

http://localhost:65317/Service1.svc

  • 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-30T09:54:39+00:00Added an answer on May 30, 2026 at 9:54 am

    I have the following code:

    [WebInvoke(ResponseFormat=WebMessageFormat.Json, RequestFormat= WebMessageFormat.Json)]
    string PostDateTimeAndReturnAsString(DateTime dateTime);
    

    The implementation of the above method as shown below:

    public string PostDateTimeAndReturnAsString(DateTime dateTime)
    {
           return dateTime.ToString();
    }
    

    My web.config as shown below:

    <services>
        <service name="XMLService.Service1" behaviorConfiguration="default">
                <endpoint address="" behaviorConfiguration="web" binding="webHttpBinding" bindingConfiguration="RestBinding" name="Service1" contract="XMLService.IService1" />
        </service>
    </services>
    <behaviors>
          <endpointBehaviors>
        <behavior name="web">
             <webHttp />
        </behavior>
    </endpointBehaviors>
    </behaviors>
    

    My raw request from fiddler as below:

    POST http://localhost/XMLService/Service1.svc/postdatetimeandreturnasstring HTTP/1.1
    User-Agent: Fiddler
    Content-Type: application/json
    Host: localhost
    Content-Length: 30
    
    "\/Date(1330081170513+0000)\/"
    

    I get back the a HTTP 200 OK code with the following response back:

    "24\/02\/2012 11:07:59"
    

    NOTE: when date time is a parameter that needs to be passed in json format that is the way you need to pass it as shown in the raw request format ( the value that i used was during my execution the current date time, using the same value should return the value as shown below)

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

Sidebar

Related Questions

I have a WCF 4.0 REST service. If I enable automaticFormatSelectionEnabled in the web.config
I have an WCF REST Service as an endpoint for the Azure Storage .
So I have wcf rest service which succesfuly runs from a console app, if
If I have a wcf rest service such as http://somedomain.com/service.svc/uniqueid/somemethod/parameter1 then is there a
We have a ASP.NET application running and i have added a WCF Rest service
I have an asp.net 4 application that hosts a WCF REST service via WebServiceHost...
I have ASP MVC 3 application. I created WCF REST JSON Service and added
I have a REST service consumed by a .Net WCF client. When an error
I have a C# REST Service in WCF that sits on top of an
I have a WCF-REST service with one method which returns a string: [ServiceContract] public

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.