0
RPCServiceClientと非同期呼び出しを使用するとNullPointerExceptionがスローされますが、RPCServiceClient.invokeBlockingを使用すると正常です。 私のaxis2バージョンは1.6.4です。axis2 invokeNonBlocking NullPointerException
これは私のコードです:
public void sendMsg(String xmldata, AxisCallback callback) throws AxisFault {
\t String webServiceURL = "http://171.8.212.68:8191/axis2/services/UserService";
String sendflag = "true";
if ("true".equals(sendflag)) {
RPCServiceClient serviceClient = new RPCServiceClient();
Options options = serviceClient.getOptions();
EndpointReference targetEPR = new EndpointReference(webServiceURL);
options.setTo(targetEPR);
Object[] opAddEntryArgs = new Object[]{xmldata};
QName opAddEntry = new QName("http://downstream.sysinterface.topsms.topnet.com", "sendMsg");
if (callback == null) {
callback = new AxisCallback() {
public void onComplete() {
// TODO Auto-generated method stub
System.out.println("***********onComplete");
}
public void onError(Exception exception) {
// TODO Auto-generated method stub
exception.printStackTrace();
System.out.println("***********onError:"+exception.getMessage()+":"+ Arrays.toString(exception.getStackTrace()));
System.out.println(getStackTrace(exception));
}
public void onFault(MessageContext context) {
// TODO Auto-generated method stub
System.out.println("***********onFault");
}
public void onMessage(MessageContext context) {
// TODO Auto-generated method stub
System.out.println("***********onMessage");
}
};
}
serviceClient.invokeNonBlocking(opAddEntry, opAddEntryArgs, callback);
serviceClient.cleanupTransport();
serviceClient.cleanup();
}
}
だけでなく、労働と非作業コードの両方を投稿してくださいとしてエラーメッセージのスタックトレース。 – betseyb