문제

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