本页内容是《用asp如何开发wap push?》同时我们还提供济宁地区的网站建设,百度,雅虎,google的推广,点金,商友,等营销软件
请输入关键字:

标题搜索 内容搜索  

你现在所在的位置->首页->wap->用asp如何开发wap push?

用asp如何开发wap push?

时间:[2007-11-2 17:31:56]     作者:作者不详

      对于WAP PUSH服务,CP/SP需要向中国联通申请该类服务,并且CP/SP所提供的WAP PUSH内容所在的服务器能够与中国联通的 Openwave PUSH Server连通,连接方式分为内网连接和公网连接两种方式,由CP/SP根据自身实际情况选择连接方式。Openwave PUSH Server分别位于北京上海两地,CP/SP根据就近原则选择需要连接的Openwave PUSH Server。CP/SP需要向中国联通提交内容应用服务器的主域名或IP地址。
北京Openwave PUSH SERVER的地址为:
http://211.94.69.231:9001/pap(公网)
http://10.2.17.66:9001/pap(内网)
上海Openwave PUSH SERVER的地址为:
http://211.95.66.70:9001/pap(公网)
http://10.95.17.66:9001/pap(内网)。

下面以向北京Openwave PUSH SERVER发送请求为例说明如何提供WAP PUSH服务:
/*
* Title: WAP Push Library Service Indication Payload Example
* Description: A basic Push Submission example using a
* Service Indication payload 本文章首发:http://www.7wap.cn,WAP资讯
*/
import java.io.IOException;
import java.io.FileNotFoundException;
import java.net.MalformedURLException;
import java.net.URL;
import com.openwave.wappush.*;
public class ServiceInd {
//Constants used in this example.
static final String address = "手机标识" +
"/TYPE=USER@gatewaybj.uni-info.com.cn";
static final String ppgAddress =
"http://211.94.69.231:9001/pap";
static final String SvcIndURI =
"http://devgate2.openwave.com/cgi-bin/mailbox.cgi";
static URL ppgURL = null;
static URL siURI = null;
public void SubmitMsg() throws WapPushException, IOException,
MalformedURLException {
//Instantiate and initialize the Pusher object.
Pusher ppg = new Pusher(ppgURL);
ppg.initialize();
//Instantiate the Service Indication object. 看WAP信息到,WAP资讯网
//This is the text string to send to the client device.
String alertText = "Mobile Mail: New message!";
ServiceIndication serviceIndication =
new ServiceIndication(alertText);
//Set the URI for this SI.
serviceIndication.setHref(siURI);
//Add some optional information to the SI.
ServiceIndicationInfo info =
new ServiceIndicationInfo("Mailbox", "Full");
info.AddInfoBlock("ReadMessages", "All");
serviceIndication.setInfo(info);
//Set the Service Indication action to signal-high.
serviceIndication.setAction(ServiceIndicationAction.signalHigh);
//Add some optional time information.
serviceIndication.setExpires(
new DateTime(2004, 6, 15, 12, 0, 1));
serviceIndication.setCreated(
new DateTime("2002-06-15T12:00:00Z")); 本文章首发:http://www.7wap.cn,WAP资讯网
//Instantiate the push message object and set some
//optional information.
PushMessage pushMessage = new PushMessage(pushID, address);

pushMessage.setDeliverBeforeTimestamp(new
DateTime("2004-06-15T12:00:01Z"));
//Instantiate a MimeEntity and add the PushMessage
//and ServiceIndication objects.
MimeEntity me = new MimeEntity();
me.addEntity(pushMessage);
me.addEntity(serviceIndication);
//Send the push message
PushResponse pushResponse = (PushResponse) ppg.send(me);
//Read some information from the response.
System.out.println("reply-Time = " +
pushResponse.getReplyTime());
System.out.println("response-result-code = " +
pushResponse.getResultCode());
System.out.println("response-result-desc = " +
pushResponse.getResultDesc()); 7WAP
}//SubmitMsg()
public static void main(String[] args) throws WapPushException,
IOException {
try {
ppgURL = new URL(ppgAddress);
siURI = new URL(SvcIndURI);
ServiceInd si = new ServiceInd();
si.SubmitMsg();
}
//Handle possible exceptions.
catch (BadMessageException exception) {
System.out.println("*** ERROR - bad message exception");
BadMessageResponse response = exception.getResponse();
System.out.println("*** ERROR = " +
response.getBadMessageFragment());
}
catch (WapPushException exception) {
System.out.println("*** ERROR - WapPushException (" +
exception.getMessage() + ")");
}
catch (FileNotFoundException exception) {
System.out.println("*** ERROR - input file not found"); WAP业界动态
}
catch (MalformedURLException exception) {
System.out.println("*** ERROR - malformed PPG URL");
}
catch (IOException exception) {
System.out.println( "*** ERROR - I/O exception");
}
catch (Exception exception) {
System.out.println("*** ERROR - exception(" +
exception.getMessage() + ")");
}
}//main()
}//class ServiceInd

【声明】本站刊载的《用asp如何开发wap push?》一文如果有侵害你权益的情况,请联系我们。我们将及时采取措施。
QQ:44637339 Email:just6@163.com Tel:13355163107 Lining studios

友情链接

本页内容是《用asp如何开发wap push?》 返回顶部
© 2001-2024 Lining studios 济宁速创科技有限公司, All Rights Reserved
 Processed Time:46.875ms
中华人民共和国信息产业部网站备案号: 鲁ICP备09103015号-1