Question

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

Was it helpful?

Solution

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..

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top