⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sendmessage.java~1~

📁 电信ISAG的服务连接和服务
💻 JAVA~1~
字号:
package test.wapTest;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */
import cn.com.chinatelecom.www.wsdl.ctcc.wap_push.send.v1_0.service.*;
import cn.com.chinatelecom.www.wsdl.ctcc.wap_push.send.v1_0._interface.*;
import java.net.URL;
import cn.com.chinatelecom.www.schema.ctcc.wap_push.v1_0.*;
import org.apache.axis.types.*;
import cn.com.chinatelecom.www.schema.ctcc.common.v2_1.*;
import org.apache.axis.types.URI;

public class sendMessage {
  public sendMessage() {
  }
  public static void main(String[] args) {
    try {
      URL url = new URL(
          "http://215.152.1.115:8080/sagWeb/services/SendWapMessage");
      SendWapMessageServiceLocator locator = new SendWapMessageServiceLocator();
      SendWapMessage service = locator.getSendWapMessage(url);

      int jf = 1;
      int multi = 2;
      int rec = 1;

      org.apache.axis.types.URI[] addresses = null;
      String num0 = "aa618801234011";

      if (multi==1)
      {
        addresses = new org.apache.axis.types.URI[3];
        String num1 = "0.0.0.0";
        String num2 = "ZS618801234010";
//        String num3 = "8618801234012";
//        String num4 = "05195555004";
        addresses[0] = new org.apache.axis.types.URI("tel:" + num0);
        addresses[1] = new org.apache.axis.types.URI("tel:" + num1);
        addresses[2] = new org.apache.axis.types.URI("tel:" + num2);
//        addresses[3] = new org.apache.axis.types.URI("tel:" + num3);
//        addresses[4] = new org.apache.axis.types.URI("tel:" + num4);
      }
      else
      {
        addresses = new org.apache.axis.types.URI[1];
        addresses[0] = new org.apache.axis.types.URI("tel:" + num0);
      }

      //org.apache.axis.types.URI targetURl = new org.apache.axis.types.URI("http://10.40.57.222:8083/2.gif");
      org.apache.axis.types.URI targetURl = new org.apache.axis.types.URI("http://192.168.140.115");
      //String senderAddress = "3355400";
      String senderAddress = "325";
      String subject ="WAP PUSH TEST";// "中兴彩信测试";
      cn.com.chinatelecom.www.schema.ctcc.wap_push.v1_0.
          MessagePriority priority = MessagePriority.Normal;

      ChargingInformation charging = null;
      if (jf==1)
      {
        charging = new ChargingInformation("haha",
                                "yes", new java.math.BigDecimal("100"), num0);
      }
      SimpleReference receiptRequest = null;
      if (rec==1)
      {
        try {
          receiptRequest = new SimpleReference(new org.apache.axis.
                                               types.URI("tel:" + num0), "1",
                                               "333");

        }

        catch (Exception ex) {
          ex.printStackTrace();
        }
      }
      String res = service.sendMessage(addresses, targetURl
                                       , senderAddress, subject,
                                       priority, charging, receiptRequest);
      System.out.println("res:" + res);
    }

    catch (Exception ex) {
      ex.printStackTrace();
    }

  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -