解决方案 »

  1.   

    try一下,然后重连不就好了?
      

  2.   

    用的是联通提供的jar包,没看到在那创建socket啊
    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());
            }
        }
      

  3.   

     /**
         * 消息数据检测,格式不正确
         */
        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;我也觉得是联通给的参数表不对,很坑爹啊,找不到联通的负责人。多谢你的耐心解答啊
      

  4.   

    lz 我现在也是出现 SGIP_LOGIN_FAIL_ERR = -4; 你是怎么解决的,公司给的 账号密码 应该是对的。