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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T17:58:19+00:00 2026-05-12T17:58:19+00:00

I created a minuscule WCF service as a proof of concept. I eventually want

  • 0

I created a minuscule WCF service as a proof of concept. I eventually want to have a WCF service exposed very simply over the web for any consumer to call by URL with the ability to post data to some of the methods (non-.Net clients, so it should appear to the public as a simple web service). I use the webHttpBinding, enabled webHttp in my endpointBehavior, and added a few methods to the service with WebGetAttribute and one with WebInvokeAttribute for post. The WebGet stuff works without a hitch. I can simply browse to the url pattern defined in my UriTemplate from a web browser, pass parameters in from url args, return whatever data type (XElement, string, int, etc). I can also call this via WebClient.DownloadString from any other app type locally.

So, WebInvoke (Post) isn’t quite behaving as well. Obviously browsing to the UriTemplate pattern isn’t valid, because this issues a “GET” via the browser, so I get Service – Method Not Allowed. I’m ok with that. However, as soon as I write some simple WebClient.UploadString stuff to call the service via Post, I get errors.

At first I got 415 Method Not Allowed. I googled, enabled serviceDebug includeExceptionDetailInFaults in my serviceBehavior, and now the error is 400 Bad Request. I further googled, and found suggestions that I explicitly set the WebClient.Encoding to UTF8 and set my Content-type header to “application/xml; charset=utf-8″ prior to the call. Same thing. I tried this with other mime types (text/plain, etc) and formatted the uploaded string all sorts of ways (key=value, key=’value’, value, ‘value’, \”value\”, etc). I even tried UrlEncoding it. I even scrapped the whole WebClient and went the old HttpWebRequest/HttpWebResponse route, and I still get the same error.

At this point, I don’t believe the issue is on the client side. I’m not very experienced with WCF, so I could very easily be doing something wrong there. For instance, I’m using a single service and a single endpoint. Is that cool for both get and post exposed service methods? Do they need slight differences in either serviceBehavior and/or endpointBehavior? I’ve seen a few examples online touting that WebInvoke over Http Post just works, so I’m pretty convinced that I’m just missing something simple on the service.

  • 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-12T17:58:19+00:00Added an answer on May 12, 2026 at 5:58 pm

    To test your WCF REST service, you should definitely get some help in the form of Fiddler, which allows you to easily create and send off POST requests to your URL. This would make sure you’re really getting proper POST requests into your service.

    Also, if you haven’t already, check out the Pluralsight series of screencasts on WCF REST Starter Kit – this one on HTTP Plain XML (POX) Services in particular. Aaron Skonnard explains very nicely and very clearly how to do things and what problems to get around. Highly recommended!

    Marc

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

Sidebar

Related Questions

Created .NET WCF service, tested it - works. Generated schemas from Data and service
Created a web role project on Azure. Looking at the service definition file I
Created a WCF service that is being called by a Silverlight app. Both reside
Created a simple WCF service that basically logs to a db. the build is
created a very basic WS. i have LoggingHandler, Test, TestImpl, & TestPublisher. my publisher
i have created a coverflow using the code given by http://android.jmsliu.com/138/android-infinite-loop-gallery.html . And it
Created a stored procedure in SQL 9 (2005) and have since upgraded to SQL
Created BroadcastReceiver which displays application name and version number on install/ uninstall of any
created a new IIS7 web site with Intergrated .net 4.0 app pool. URLs ending
I created a new MVC 4 web project (VS 2012 Express) and installed the

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.