Link to home
Start Free TrialLog in
Avatar of brainstogether
brainstogether

asked on

WEB SERVICE GIVING "The request failed with HTTP status 406: Not Acceptable". ERROR

Hi All,
I have made a webservice and it is working fine on the local server but when I upload to our main SERVER and add its reference to winform and try to call it, it is giving a strange error and I am not able to debug what the problem is. the error that appears is

Server Error in '/WebApplication2' Application.
--------------------------------------------------------------------------------

The request failed with HTTP status 406: Not Acceptable.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The request failed with HTTP status 406: Not Acceptable.

I couldn't find what the problem is all about. Kindly help
Avatar of majodio
majodio

Make sure that any references to old URLs in your web service have been changed to match your production server.

Very strange that I could not find anything on Google about this problem.
ASKER CERTIFIED SOLUTION
Avatar of majodio
majodio

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of brainstogether

ASKER

Yes majodio I also didnt find anything on google so its too hard for me...so just want some Ideas from fellow experts.
Actually this error is coming when I try to call the webservice from within an ASP application folder....I made it a virtual directory though and I can browse the webservice but at the time of calling ...it gives error in the invoke function in references.cs.
When I made it a virtual directory in a folder that contains the dotnet application it did run well....so I checked the folder permissions but they were all same.
The jist is that it is creating the object of the class in webservice too but when I try to call the function it gives that 406 Error and points to the invoke function in reference.cs file.
please let me know anything u can think of...I will also try out and if even the guesses are correct.... I will be happy to give u the points.
Hmmm...  Interesting...  I guess that your testing so far points to a permissions problem.  Are you running the web service in the root of the web server?  Are you sure that the ASP.Net user has Read/List permissions to that folder?
yes the webservice is in root and the folder under which I have made it a virtual directory is also having the ASP.Net user Read/List permission
Can you invoke the web service by hand?  In essence without using the Winform and just browsing to it with a web browser?  Also, are you sure that you're handling any error correctly in your code?

I'm guessing you've tried all of these things, but I don't have a clue on this one.  I'll continue to think about it, though.