Hi,
Can anybody help me? I'm fairly new to Drupal and new to PHP, so apologies if I'm asking stupid questions.
I'm trying to run a .jsp that is hosted on a different hosting service. It returns a text string that I want to be able to parse using php.
I'm using the following php, where $url is the url to the .jsp :
$http_result = drupal_http_request($url, $headers = array(), $method = 'GET', $retry = 3);
print_r($http_result);
Information about the server where the jsp is stored is printed, along with info about the content of cookies, but I'm getting the following error message below and the text string isn't returned.
500 Internal Server Error
Servlet error: An exception occurred. The current application deployment descriptors do not allow for including it in this response. Please consult the application log for details.
Any ideas?
Thanks very much
Comments
What happens if you type the
What happens if you type the URL in your browsers address/url bar?
Hi Nevets In the browser's
Hi Nevets
In the browser's address bar it displays the text returned by the jsp.
Did you try 'POST' instead of
Did you try 'POST' instead of 'GET'?
Yes, unfortunately this gave
Yes, unfortunately this gave me exactly the same error. I was wondering if this could be a cross-domain problem. Could the error be caused by restrictions on trying to run the jsp from a different domain?
There shouldn't be any
There shouldn't be any cross-doman problems because you are just performing an http request that is similar to the successful request your browser is making to the same resource.
The error you are seeing is on the java side, do you have access to the jsp/servlet? The error is likely being logged somewhere on the java side. Without knowing what the jsp does, it's hard to know what the problem is, but it may be doing something based on the headers it receives (or doesn't receive with drupal_http_request).
Thanks mitchmac, that's
Thanks mitchmac, that's really useful to know. I don't have access to the jsp/servlet, but I'll ask our java developers to check the logs.