我尝试使用“submitMulti(request);”尝试发送多条消息方法。即使所有参数都已正确设置,控制台中也会显示“提交多操作faild.java.lang.NullPointerException”的错误消息。我需要快速回答。 这是我的代码。
SubmitMultiSM request = new SubmitMultiSM();
SubmitMultiSMResp response;
for (int i=0; i<3; i++) {
request.addDestAddress(new DestinationAddress("94710486836"););
}
// set other values
request.setServiceType("CMT");
request.setSourceAddr("94115933333");
request.setReplaceIfPresentFlag(replaceIfPresentFlag);
request.setShortMessage("Test");
request.setScheduleDeliveryTime(scheduleDeliveryTime);
request.setValidityPeriod(validityPeriod);
request.setEsmClass(esmClass);
request.setProtocolId(protocolId);
request.setPriorityFlag(priorityFlag);
request.setRegisteredDelivery(registeredDelivery);
request.setDataCoding(dataCoding);
request.setSmDefaultMsgId(smDefaultMsgId);
response = session.submitMulti(request);
谢谢。