c# - The remote server returned an error: "(405) Method Not Allowed" -


After reading different answers against a single thread, I mentioned almost all the options in my discussion, Also getting the error:

Error number 1 : Remote server returned an error: (404) not found. Error code 2 : Remote server returned an error: (405) method is not allowed .

Below is my code:

  var httpWebRequest = (HttpWebRequest) WebRequest.Create ("url? Parameter1 = PC and user = U1 and password = P1 "); HttpWebRequest.ContentType = "App / Jason; Charset = UTF-8"; HttpWebRequest.method = "POST"; HttpWebRequest.Accept = "App / Jason"; Var httpResponse = (HttpWebResponse) httpWebRequest.GetResponse ();   

I get an error on the last line i.e.

  var httpResponse = (HTTP webbense) httpWebRequest.GetResponse ();   

If I use httpWebRequest.Method = "get" then I get the error number 1 mentioned above and if I httpWebRequest.Method = "Post" I get error number 2.

Use:

  [Operation Contract] [WebInvoc (method = "Post", Response format = Web message format. Jason, EuryTaplet = "ABCNS")   

On your service page, where you declare your method, type in the upper case Posts I think you are typing in lowercase.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -