If I understand your question, you would like to get back the raw content that was delivered from the backend server in a 4xx response, as string  data in the  dataset at the client?


WEB-INF/lps/server/src/org/openlaszlo/data/HTTPDataSource.java contains a method called getHTTPData() which checks for the 4xx code, and it calls getDataOnce() which
does the actual proxied HTTP request. I need to look at it more closely to see what it is doing with the returned response content. From what you are seeing, it appears it is throwing it on the floor at the moment. It certainly ought to try to package up the response body as a parameter which goes back to the client so the app can see it. I have filed a placeholder bug for this to investigate further.

http://www.openlaszlo.org/jira/browse/LPP-2607






On 9/5/06, James Howe <[EMAIL PROTECTED]> wrote:
I have an OpenLaszlo application (currently running 3.2) running in
proxied mode which is using datasets to retrieve and display information.
The datasets are accessing some web services URL's which are running on a
web server.  When the request to the web service fails (perhaps the
information in the request was invalid, the user wasn't authorized to
perform the action, etc.) the web service returns an appropriate HTTP
status code (400, 403, etc.) along with some XML content which explains
the failure.  It's very similar to the way Amazon's S3 REST API works and
is consistent with the HTTP spec which says:

"The 4xx class of status code is intended for cases in which the client
seems to have erred. Except when responding to a HEAD request, the server
SHOULD include an entity containing an explanation of the error situation,
and whether it is a temporary or permanent condition. These status codes
are applicable to any request method. User agents SHOULD display any
included entity to the user."

It seems, however, that when I make the request through my dataset, I
never see the information which was returned by the web service.  When an
error occurs I use the getErrorString method on dataset to retrieve the
error message.  The message I get back is 'data source error for
http://... HTTP Status Code: xxx'.  The actual result set seems to contain
an 'error' element which has a 'status' attribute and a 'msg' attribute,
but no information from the actual request.

Is there a way to get at the actual information returned from the
request?  I need this information in order to produce proper error
diagnostics to my user.

Thanks!

--
James Howe

_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user



--
Henry Minsky
Software Architect
[EMAIL PROTECTED]

_______________________________________________
Laszlo-user mailing list
[email protected]
http://www.openlaszlo.org/mailman/listinfo/laszlo-user

Reply via email to