我通过webservice向远程数据库插入数据,成功插入部分数据(每次程序运行成功插入的数据量不一定相同)后,程序抛出如下异常,程序中断。问:为什么?怎么解决?
Exception in thread main AxisFault
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (0)null
faultActor:
faultNode:
faultDetail:
{}:return code: 0
{http://xml.apache.org/axis/}HttpErrorCode:0
(0)null
at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:744)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
at org.apache.axis.client.Call.invoke(Call.java:2748)
at org.apache.axis.client.Call.invoke(Call.java:2424)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at biz.HospBizRefreshRealtimereg.main(HospBizRefreshRealtimereg.java:83)
------解决方法--------------------------------------------------------
捕捉他,然后返回错误结果对象。例如:如果操作返回的结果对象是一个GeneralResult,那么
try
{
result=调用ws的语句;
return result;
}catch(Exception ex)
{
return new GeneralResult(new Integer(-1), "调用开户接口时产生异常!");
}