If the REST Web Services server cannot process the input in your request it will return HTTP status code 500 Internal Server Error.

The following example shows an exception that has been returned by the REST Web Services server. HTTP status code 500 Internal Server Error indicates that the server cannot process the request because of a problem interpreting the input. The server includes the name of the exception (org.dom4j.DocumentException) in the message body of the response.

curl -v -c cookies.txt -X POST \
-H "Content-Type: application/xml" -d "This is not XML." \
http://myserver:8080/rest/bean/atg/userprofiling/ProfileServices/loginUser

* About to connect() to myserver port 8080 (#0)
*   Trying 12.34.567.890... connected
* Connected to myserver (12.34.567.890) port 8080 (#0)
> POST /rest/bean/atg/userprofiling/ProfileServices/loginUser HTTP/1.1
> User-Agent: curl/7.21.1 (i386-pc-win32) libcurl/7.21.1 zlib/1.2.5
> Host: myserver:8080
> Accept: */*
> Content-Type: application/xml
> Content-Length: 16
>
< HTTP/1.1 500 Internal Server Error
< Server: Apache-Coyote/1.1
< X-Powered-By: Servlet 2.5; JBoss-5.0/JBossWeb-2.1
* Added cookie JSESSIONID="24C3CC9056EA3A1B62DD2002DEDFAA7F" for domain myserver, path /, expire 0
< Set-Cookie: JSESSIONID=24C3CC9056EA3A1B62DD2002DEDFAA7F; Path=/
< X-ATG-Version: version=QVRHUGxhdGZvcm0vMTAuMCxDb21tZXJjZVJlZmVyZW5jZVN0b3JlLzEwLjAgWyBQbGF0Zm9ybUxpY2Vuc2U
vMCBCMkNMaWNlbnNlLzAgIF0=
< Content-Type: text/html;charset=utf-8
< Content-Length: 1776
< Date: Wed, 27 Oct 2010 18:15:29 GMT
< Connection: close
<
<html><head><title>JBoss Web/2.1.3 - Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color: black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 500 - org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog. Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.</h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u>org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog. Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.</u></p><p><b>description</b> <u>The server encountered an internal error (org.dom4j.DocumentException: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog. Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.) that prevented it from fulfilling this request.</u></p><HR size="1" noshade="noshade"><h3>JBoss Web/2.1.3</h3></body></html>* Closing connection #0