<p>In the process of developing my first WCF service and when I try to use it I get "Method not Allowed" with no other explanation. </p>

<p>I've got my interface set up with the ServiceContract and OperationContract:</p>

<pre><code>    [OperationContract]
    void FileUpload(UploadedFile file);
</code></pre>

<p>Along with the actual method:</p>

<pre><code>    public void FileUpload(UploadedFile file) {};
</code></pre>

<p>To access the Service I enter <a href="http://localhost/project/myService.svc/FileUpload" rel="noreferrer">http://localhost/project/myService.svc/FileUpload</a>
but I get the "Method not Allowed" error</p>

<p>Am I missing something?</p>

[{'answer_id': 41205, 'author': 'Jeremy McGee', 'author_id': 3546, 'author_profile': 'https://Stackoverflow.com/users/3546', 'pm_score': 2, 'selected': False, 'text': '<p>The basic intrinsic types (e.g. <code>byte</code>, <code>int</code>, <code>string</code>, and arrays) will be serialized automatically by WCF. Custom classes, like your UploadedFile, won\'t be. </p>\n\n<p>So, a silly question (but I have to ask it...): is UploadedFile marked as a <code>[DataContract]</code>? If not, you\'ll need to make sure that it is, and that each of the members in the class that you want to send are marked with [DataMember]. </p>\n\n<p>Unlike remoting, where marking a class with [XmlSerializable] allowed you to serialize the whole class without bothering to mark the members that you wanted serialized, WCF needs you to mark up each member. (I believe this is changing in .NET 3.5 SP1...)</p>\n\n<p>A tremendous resource for WCF development is what we know in our shop as "the fish book": <a href="http://www.amazon.co.uk/Programming-WCF-Services-Juval-Lowy/dp/0596526997/ref=sr_1_4?ie=UTF8&amp;s=books&amp;qid=1220419338&amp;sr=8-4" rel="nofollow noreferrer">Programming WCF Services</a> by Juval Lowy. Unlike some of the other WCF books around, which are a bit dry and academic, this one takes a practical approach to building WCF services and is actually useful. Thoroughly recommended.</p>\n'}, {'answer_id': 41301, 'author': 'Ubiguchi', 'author_id': 2562, 'author_profile': 'https://Stackoverflow.com/users/2562', 'pm_score': 1, 'selected': False, 'text': '<p>It sounds like you\'re using an incorrect address:</p>\n\n<blockquote>\n  <p>To access the Service I enter <a href="http://localhost/project/myService.svc/FileUpload" rel="nofollow noreferrer">http://localhost/project/myService.svc/FileUpload</a></p>\n</blockquote>\n\n<p>Assuming you mean this is the address you give your client code then I suspect it should actually be:</p>\n\n<pre><code>http://localhost/project/myService.svc\n</code></pre>\n'}, {'answer_id': 545754, 'author': 'Ries', 'author_id': 64565, 'author_profile': 'https://Stackoverflow.com/users/64565', 'pm_score': 7, 'selected': True, 'text': '<p>Your browser is sending an HTTP GET request: Make sure you have the WebGet attribute on the operation in the contract:</p>\n\n<pre><code>[ServiceContract]\npublic interface IUploadService\n{\n    [WebGet()]\n    [OperationContract]\n    string TestGetMethod(); // This method takes no arguments, returns a string. Perfect for testing quickly with a browser.\n\n    [OperationContract]\n    void UploadFile(UploadedFile file); // This probably involves an HTTP POST request. Not so easy for a quick browser test.\n }\n</code></pre>\n'}, {'answer_id': 2018327, 'author': 'darthjit', 'author_id': 121397, 'author_profile': 'https://Stackoverflow.com/users/121397', 'pm_score': 6, 'selected': False, 'text': '<p>If you are using the <code>[WebInvoke(Method="GET")]</code> attribute on the service method, make sure that you spell the method name as "GET" and not "Get" or "get" since it is case sensitive! I had the same error and it took me an hour to figure that one out.  </p>\n'}, {'answer_id': 4752095, 'author': 'Sameh', 'author_id': 583561, 'author_profile': 'https://Stackoverflow.com/users/583561', 'pm_score': 0, 'selected': False, 'text': '<p>Only methods with WebGet can be accessed from browser IE ; you can access other http verbs by just typing address</p>\n\n<p>You can either try Restful service startup kit of codeples or use fiddler to test your other http verbs</p>\n'}, {'answer_id': 12079267, 'author': 'sandeep', 'author_id': 1617832, 'author_profile': 'https://Stackoverflow.com/users/1617832', 'pm_score': 0, 'selected': False, 'text': '<p>you need to add in web.config  </p>\n\n<pre><code>&lt;endpoint address="customBinding" binding="customBinding" bindingConfiguration="basicConfig" contract="WcfRest.IService1"/&gt;  \n\n&lt;bindings&gt;  \n    &lt;customBinding&gt;  \n        &lt;binding name="basicConfig"&gt;  \n            &lt;binaryMessageEncoding/&gt;  \n            &lt;httpTransport transferMode="Streamed" maxReceivedMessageSize="67108864"/&gt;  \n        &lt;/binding&gt;  \n    &lt;/customBinding&gt; \n</code></pre>\n'}, {'answer_id': 27261464, 'author': 'flobadob', 'author_id': 339348, 'author_profile': 'https://Stackoverflow.com/users/339348', 'pm_score': 1, 'selected': False, 'text': '<p>I\'ve been having this same problem for over a day now - finally figured it out. Thanks to @Sameh for the hint.</p>\n\n<p>Your service is probably working just fine. Testing POST messages using the address bar of a browser won\'t work. You need to use Fiddler to test a POST message.</p>\n\n<p>Fiddler instructions...\n<a href="http://www.ehow.com/how_8788176_do-post-using-fiddler.html" rel="nofollow">http://www.ehow.com/how_8788176_do-post-using-fiddler.html</a></p>\n'}, {'answer_id': 30732917, 'author': 'dudeNumber4', 'author_id': 74000, 'author_profile': 'https://Stackoverflow.com/users/74000', 'pm_score': 0, 'selected': False, 'text': '<p>My case: configuring the service on new server.  ASP.NET 4.0 was not installed/registered properly; svc extension was not recognized.</p>\n'}, {'answer_id': 62238509, 'author': 'Stuart Smith', 'author_id': 4089404, 'author_profile': 'https://Stackoverflow.com/users/4089404', 'pm_score': 2, 'selected': False, 'text': '<p>I ran into this exact same issue today. I had installed IIS, but did not have the activate WCF Services Enabled under .net framework 4.6.</p>\n\n<p><a href="https://i.stack.imgur.com/mEoWS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mEoWS.png" alt="enter image description here"></a></p>\n'}]
['https://Stackoverflow.com/questions/41155', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/831/']