Package cn.com.zjtelecom.smgp

Examples of cn.com.zjtelecom.smgp.Client


    //Ŀ����룺18918911891
    String destnum =config.get("destnum");
    String content =config.get("content");;
   
    //��ʼ��client
    Client client = new Client(host, port, 2,account, passwd,spid, 0);
   
    do{
      Deliver deliver = client.OnDeliver();
      if (deliver.IsReport==1){
        System.out.println("-----------------");
        System.out.println("Got MsgReport");
        System.out.println("-----------------");
        System.out.println("MsgID       : "+deliver.MsgID);
View Full Code Here


    String destnum = config.get("destnum");
    String content = config.get("longconent");
   

    // ��ʼ��client
    Client client = new Client(host, port, 2, account, passwd, spid, 0);

    // ����submit
    Submit submit = new Submit();
    submit.setSrcTermid(spnum);
    submit.setDestTermid(destnum);
    submit.setMsgContent(content.getBytes("iso-10646-ucs-2"));
    submit.setMsgFormat(8);
    if (productid!=null) submit.setProductID(productid);

    // ���Ͷ���
    Result[] result = client.SendLong(submit);
    for (int i = 0; i < result.length; i++) {
      System.out.println("--------------------------------");
      System.out.println("Message "+i+"");
      System.out.println("Status:" + result[i].ErrorCode);
      System.out.println("MsgID:" + result[i].ErrorDescription);
      System.out.println("--------------------------------");
    }

    // �˳�
    client.Close();

  }
View Full Code Here

    String destnum =config.get("destnum");
    String content =config.get("content");;
    String productid=config.get("productid");
   
    //��ʼ��client
    Client client = new Client(host, port, 2,account, passwd,spid, 0);
   
    //����submit
    Submit submit =new Submit();
    submit.setSrcTermid(spnum);
    submit.setDestTermid(destnum);
    submit.setMsgContent(content.getBytes("iso-10646-ucs-2"));
    submit.setMsgFormat(8);
    if (productid!=null) submit.setProductID(productid);
   
    //���Ͷ���
    Result  result =client.Send(submit);
    System.out.println("Status:"+result.ErrorCode);
    System.out.println("MsgID:"+result.ErrorDescription);
   
    //�˳�
    client.Close();

  }
View Full Code Here

TOP

Related Classes of cn.com.zjtelecom.smgp.Client

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.