Response message after invoking a jsonservice

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Response message after invoking a jsonservice

Erwan de FERRIERES-3
Hi all,

How is handled the error messages after a jsonservice event type ? Here
is a concrete example :

Go to Ajax examples, and create an example. No problem, it's working.
But if in the example/../controller.xml, line 78, you replace the name
of the service invoked for the example creation, then, when creating an
example, nothing is done. That's normal, but there is no error message
on the screen.

The only indicator we have is in the log :
2009-12-10 17:34:03,343 (http-0.0.0.0-8443-1) [
RequestHandler.java:412:ERROR] Request createExampleAjax caused an error
with the following message: Erreur lors de l'appel de l'événement:
org.ofbiz.webapp.event.EventHandlerException: Problems getting the
service model (Cannot locate service by name (eventWhichDoesntExist))

But there is nothing displayed for the user. Does anyone knows how to
display an error ?

Thanks,

--
Erwan de FERRIERES
www.nereide.biz
Reply | Threaded
Open this post in threaded view
|

Re: Response message after invoking a jsonservice

Anil Patel-3
Erwan,
Here is code snipped from checkoutProcess.js file in ecommerce component.
// Check server side error
function getServerError(data) {
    var serverErrorHash = [];
    var serverError = "";
    if (data._ERROR_MESSAGE_LIST_ != undefined) {
        serverErrorHash = data._ERROR_MESSAGE_LIST_;
        serverErrorHash.each(function(error) {
            serverError += error.message;
        });
    }
    if (data._ERROR_MESSAGE_ != undefined) {
        serverError = data._ERROR_MESSAGE_;
    }
    return serverError;
}


Thanks and Regards
Anil Patel
HotWax Media Inc
Find us on the web at www.hotwaxmedia.com or Google Keyword "ofbiz"

On Dec 10, 2009, at 11:43 AM, Erwan de FERRIERES wrote:

> Hi all,
>
> How is handled the error messages after a jsonservice event type ? Here is a concrete example :
>
> Go to Ajax examples, and create an example. No problem, it's working. But if in the example/../controller.xml, line 78, you replace the name of the service invoked for the example creation, then, when creating an example, nothing is done. That's normal, but there is no error message on the screen.
>
> The only indicator we have is in the log :
> 2009-12-10 17:34:03,343 (http-0.0.0.0-8443-1) [ RequestHandler.java:412:ERROR] Request createExampleAjax caused an error with the following message: Erreur lors de l'appel de l'événement: org.ofbiz.webapp.event.EventHandlerException: Problems getting the service model (Cannot locate service by name (eventWhichDoesntExist))
>
> But there is nothing displayed for the user. Does anyone knows how to display an error ?
>
> Thanks,
>
> --
> Erwan de FERRIERES
> www.nereide.biz

Reply | Threaded
Open this post in threaded view
|

Re: Response message after invoking a jsonservice

Erwan de FERRIERES-3
Hi Anil,

thanks for the quick response. Are you saying that for each page in
which we are calling a jsonservice, we should also have a js file which
analyse the server response ?

Cheers,

--
Erwan de FERRIERES
www.nereide.biz
Reply | Threaded
Open this post in threaded view
|

Re: Response message after invoking a jsonservice

Anil Patel-3
As of now, Its true, you need to write a method to analyze server response. This should be improved.

Thanks and Regards
Anil Patel
HotWax Media Inc
Find us on the web at www.hotwaxmedia.com or Google Keyword "ofbiz"

On Dec 10, 2009, at 12:38 PM, Erwan de FERRIERES wrote:

> Hi Anil,
>
> thanks for the quick response. Are you saying that for each page in which we are calling a jsonservice, we should also have a js file which analyse the server response ?
>
> Cheers,
>
> --
> Erwan de FERRIERES
> www.nereide.biz

Reply | Threaded
Open this post in threaded view
|

Re: Response message after invoking a jsonservice

Erwan de FERRIERES-3
Thanks Scott for resolving this issue !

Le 10/12/2009 19:15, Anil Patel a écrit :
> As of now, Its true, you need to write a method to analyze server response. This should be improved.

../..
--
Erwan de FERRIERES
www.nereide.biz
Reply | Threaded
Open this post in threaded view
|

Re: Response message after invoking a jsonservice

Scott Gray-2
Hi Erwan,

I'm not sure I've done anything to resolve this issue?  My changes  
shouldn't have had any effect on the client consuming the json response.

Regards
Scott

HotWax Media
http://www.hotwaxmedia.com

On 19/12/2009, at 3:33 AM, Erwan de FERRIERES wrote:

> Thanks Scott for resolving this issue !
>
> Le 10/12/2009 19:15, Anil Patel a écrit :
>> As of now, Its true, you need to write a method to analyze server  
>> response. This should be improved.
>
> ../..
> --
> Erwan de FERRIERES
> www.nereide.biz


smime.p7s (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Response message after invoking a jsonservice

Erwan de FERRIERES-3
Hi Scott,

the test case I described is now resolved : I have the error message in
the browser and not only in the logs.

Regards,

Le 21/12/2009 21:03, Scott Gray a écrit :

> Hi Erwan,
>
> I'm not sure I've done anything to resolve this issue? My changes
> shouldn't have had any effect on the client consuming the json response.
>
> Regards
> Scott
>
> HotWax Media
> http://www.hotwaxmedia.com
>
> On 19/12/2009, at 3:33 AM, Erwan de FERRIERES wrote:
>
>> Thanks Scott for resolving this issue !
>>
>> Le 10/12/2009 19:15, Anil Patel a écrit :
>>> As of now, Its true, you need to write a method to analyze server
>>> response. This should be improved.
>>
>> ../..
>> --
>> Erwan de FERRIERES
>> www.nereide.biz
>

--
Erwan de FERRIERES
www.nereide.biz