/** * 消息数据检测,格式不正确 */ public final static int SGIP_CHECK_MESSAGE_ERR = -1; /** * 响应超时 */ public final static int SGIP_TIME_OUT_ERR = -2; /** * 链路异常断链 */ public final static int SGIP_LINK_BREAKED_ERR = -3; /** * BIND异常,用户名或密码错误 */ public final static int SGIP_LOGIN_FAIL_ERR = -4;我也觉得是联通给的参数表不对,很坑爹啊,找不到联通的负责人。多谢你的耐心解答啊
public void sendMsg(SMSRequestDTO request) {
SGIPClient client = SGIPClient.getInstance();
initSGIPClient(client);
sgipSendMsg(request,client);
}
public void sgipSendMsg(SMSRequestDTO request,SGIPClient client) {
logger.info("[联通]进入短信发送方法");
try {
//初始化联通短信提交信息
SGIPSubmit submit =initSGIPSubmit();
submit.getBody().setChargeNumber("000000000000000000000");
submit.getBody().setUserNumber(request.getReceiveMobile());
submit.getBody().setMessageContent(request.getContent().getBytes());
SGIPRsp rsphandler = null;
rsphandler = new SGIPRsp();
submit.getHead().setSequenceNo(new SGIPSequenceNo());
//发送短信
client.sendSubmit(submit, rsphandler);
SGIPSubmitResp rsp = rsphandler.waitForSGIPSubmitResp();
System.out.println(rsp);
logger.info("<联通>向手机号<" + request.getReceiveMobile() + ">发送消息成功");
}catch (Exception e) {
logger.error("异常:", e);
logger.error("<联通>向手机号<" + request.getReceiveMobile() + ">发送消息失败");
throw new SMSSendingException(e.getMessage());
}
}
* 消息数据检测,格式不正确
*/
public final static int SGIP_CHECK_MESSAGE_ERR = -1;
/**
* 响应超时
*/
public final static int SGIP_TIME_OUT_ERR = -2;
/**
* 链路异常断链
*/
public final static int SGIP_LINK_BREAKED_ERR = -3;
/**
* BIND异常,用户名或密码错误
*/
public final static int SGIP_LOGIN_FAIL_ERR = -4;我也觉得是联通给的参数表不对,很坑爹啊,找不到联通的负责人。多谢你的耐心解答啊