Create WAP Push SMS Messages (from C# to JAVA)
猪年无聊,改了一个代码,有点D版那个意思,把WAP PUSH的C#代码改到了JAVA
原来出处:
http://www.codeproject.com/cs/internet/wappush.asp
改过后的代码在下面,程序好像可以输出了WAPPUSH的结构化的东西,但是,没有在CMPP协议上测试通过。
共7个文件:
package com.wap.wbxml;
public class Runner {
/**
* @param args
*/
public static void main(String[] args) {
try
{
String recipient = ""; // mobile number to send the message to
String href = "http://wap.monternet.com"; // url of the content to be pushed
String text = "A WAP Push to 梦网 site"; // description of the content displayed to the user
PushMessage message = new PushMessage(href, text);
HexDecoder decoder = new HexDecoder();
// Console.WriteLine("SMS body");
System.out.println("SMS body");
// Console.WriteLine(body);
String body = new String(decoder.GetChars(message.GetSMSBytes()));
System.out.println(body);
body =byteToHexStr(message.GetSMSBytes());
System.out.println(body);
// this body is now ready to be sent, either via
// an SMS Web Service as shown below or
// via a mobile phone on a serial port.
// Making sure the message is flagged as containing
// a User Data Header
// A free evaluation account for this service can
// be set up at https://www.esendex.com/secure/registration/evaluation.aspx
// messenger.MessengerHeader header = new messenger.MessengerHeader();
// header.Username = ""; // username for the SMS account
// header.Password = ""; // password for the SMS account
// header.Account = ""; // account reference
//
// messenger.SendService service = new messenger.SendService();
// service.Messeng
相关文档:
Java学习从入门到精通
一、 JDK (Java Development Kit)
JDK是整个Java的核心,包括了Java运行环境(Java Runtime Envirnment),一堆Java工具和Java基础的类库(rt.jar)。不论什么Java应用服务器实质都是内置了某个版本的JDK。因此掌握JDK是学好Java的第一步。最主流的J ......
window.onerror = function() { return true; };
body {margin:0;overflow:auto;font:normal 14px Verdana;background:#fff;padding:2px 4px 0;}body, p, font, div, li { line-height: 150%;}body, td, th {color:#000000;}.i {width:100%;*width:auto;table-layout:fixed;}pre {white-space: pre-wrap;white-spa ......
整合Flex和Java—配置篇
Author:yongtree
废话就不说了,要想了解Flex的相关内容就请问一下Google,百度吧。切入正题,作为一个Java程序员学习Flex,关心的就是怎样将Flex和Java进行结合交互。带着Java程序员的思维,一开始学习Flex并没有按部就班的学习Flex的基础知识,而是想搞清楚Flex到底怎样和Java交互的。经过 ......
Java中的事务处理
一般情况下,J2EE应用服务器支持JDBC事务、JTA(Java Transaction API)事务、容器管理事务。一般情况下,最好不要在程序中同时使用上述三种事务类型,比如在JTA事务中嵌套JDBC事务。第二方面,事务要在尽可能短的时间内完成,不要在不同方法中实现事务的使用。下面我们列举两种事务处理方式。
......
我的java学习了一年有余,起初是胡乱学,后来觉得java非常有意思,并且想在这方面深入学习,现在才是Java学习真正的开始。我正在阅读corejava和编程思想,学完这三本后想搞j2ee的开发。本人对数据库也感兴趣,现在热衷于SQL,但是我相信自己最终会瞄准ORECAL(很大程度出于好奇心),其实现在觉得Java DB ......