I'm set up the web service by java、axis2, there two response type : XML and JSON,

It's run when I call the webservice which having data, but when the webservice response null data, the exception occurd.(following two picture)

and there is one part of my webservice function:

    public ViewStockHelpBuySheet[] getHelpBuySheet(String userid){
    Stock my=new Stock();

    ViewStockHelpBuySheet[] allStock=my.getHelpBuySheet(userid);
    allStock=new ViewStockHelpBuySheet[allStock.length];
    allStock=my.getHelpBuySheet(userid);
    return allStock;
}

so, how can I handle my null result ? did axis2 provides some way to handle that? thanks

error picture:

http://ppt.cc/fcEt

http://ppt.cc/mWIL

有帮助吗?

解决方案

Webservices are your programs..There is nothing special..You need to have your logic defined in it to handle your NPE exception or other type of exceptions..

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top