Search Unity

  1. We are looking for feedback on the experimental Unity Safe Mode which is aiming to help you resolve compilation errors faster during project startup.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

HTTP/1.1 500 Internal Server Error While calling a web service by wwwForm

Discussion in 'Editor & General Support' started by Sumit Kumar, Dec 6, 2012.

  1. Sumit Kumar

    Sumit Kumar

    Joined:
    Oct 19, 2012
    Posts:
    1
    HI,

    I am creating the web build which will run on the unity web player . I am getting the error which states that HTTP/1.1 500 Internal Server Error while calling the web service hosted on our data server.. But when i called the web service hosted on my IIS Server , it works fine. and the web player run the game as well on the browser. I am stuck with this problem . Can someone help me to solve this problem. I am just exhausted by this error. Thanks in advance.
     
  2. Damocles

    Damocles

    Joined:
    Jul 21, 2012
    Posts:
    39
    500 errors are most typically server misconfiguration errors of some kind. Unfortunately, they are a massive b**ch to track down as there's no definitive starting point. Some common causes for 500 errors are:

    Capitalization of URLs (only affects Apache/Unix servers). Apache sees "some-Name.html" and "some-name.html" as different pages. If your data server is Apache and the scripts run fine on your IIS server, there's a good chance this is your problem.

    Htaccess errors - if your htaccess file has a mistake in it that causes the server to loop endlessly, then you'll get a 500. Likewise, if the htaccess is very complex, you might reach a point where the server is not sure which page it's supposed to show, and returns a 500.

    Database timeouts - if your data retrieval from a SQL DB is complex and large, the connection can go to sleep (shut down silently), but on some configurations this causes the server to get confused while running your scripts because it thinks the DB is just busy. If the 500 error comes back quickly, this is not your problem - this error usually comes up after the default DB timeout of 30 seconds.

    Bad headers - depending on what you are returning from your scripts, if the headers are malformed or in some cases completely missing (rare) then you might get a 500 error as a default error instead of anything more useful. This is quite a rare occurrence, and chances are if you know enough web dev to be modifying headers to this degree, then you've probably already checked this.

    As you say it runs fine on one server but not another, I'd start going through the configurations of both servers to ensure there are no obvious differences. It will most likely be something simple, but not necessarily obvious.
     
  3. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    5,220
    If this is a .Net webservice, then it's usually because of a bug in the webservice - unable to find and/or deserialize the objects (not passed correctly, XML is wrong, etc). You should put a breakpoint in the webservice where it is being called, and step into it to see what is happening.
    If it's not a .Net webservice, then I have nothing for you.
     
  4. wechat_os_Qy00Ucf9AazrQ3c29B_s7Nv7o

    wechat_os_Qy00Ucf9AazrQ3c29B_s7Nv7o

    Joined:
    Mar 27, 2020
    Posts:
    3
unityunity