0

I get the following error when calling a SOAP webservice in php (NuSOAP) from C# .NET 2.0 application:

The request failed with http status 406: not acceptable

How do I fix the error? And how do I reproduce the same error on another computer that is not showing the above error?

NuSOAP is at: http://sourceforge.net/projects/nusoap/

Please note: The solution of the problem is at: How can I disable mod_security in .htaccess file?

Community
  • 1
  • 1
Computer User
  • 2,839
  • 4
  • 47
  • 69
  • You're not providing enough information. How is the NuSOAP service hosted? The NuSOAP code doesn't contain the phrase `406`, so I suspect it to be thrown by mod_security in Apache, see question linked as possible duplicate. – CodeCaster Feb 10 '14 at 13:26
  • @CodeCaster It is hosted on CPanel PHP web hosting. I checked the link. Should I contact the web hosting company to make the change? Or can it be done by changing code in NuSOAP library? – Computer User Feb 10 '14 at 13:30
  • 1
    No, the request doesn't end up in the NuSOAP code because the web server or a filter denies the request. See [this question](http://stackoverflow.com/questions/12928360/how-to-disable-mod-security-in-htaccess-file) to try and disable it from `.htaccess` to see whether that works. _When_ it does, you might want to ask your hoster to whitelist the URL. – CodeCaster Feb 10 '14 at 13:32
  • @CodeCaster Great! I will try that now. Will you be available for help in a few mins while I test? – Computer User Feb 10 '14 at 13:34
  • @CodeCaster will changing .htaccess affect the NuSOAP webservice code located in a sub directory of the website? Because I have code in the folder: website.com/service/soap.php while .htaccess is in root directory website.com – Computer User Feb 10 '14 at 13:39
  • @CodeCaster can you put it as an answer so that others will also benefit? I will select that as the best answer. The solution to my above problem is at: http://stackoverflow.com/questions/12928360/how-to-disable-mod-security-in-htaccess-file – Computer User Feb 10 '14 at 15:27
  • I can't, as your question has been marked as a duplicate of [this question](http://stackoverflow.com/questions/13500686/406-not-acceptable-error-get-parameter-issue). If they were correct, feel free to upvote them. :-) – CodeCaster Feb 10 '14 at 15:28
  • @CodeCaster Ok. sure. – Computer User Feb 10 '14 at 15:29

0 Answers0