1

我试图通过使用“submitMulti(request);”发送多条消息 方法。即使所有参数都已正确设置,控制台中仍会出现错误消息“提交多操作失败。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);

谢谢你。

4

0 回答 0