日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

用asp如何开发wap push(转)

發布時間:2023/12/10 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 用asp如何开发wap push(转) 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
對于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
*/
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.
//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"));
//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());
}//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");
}
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

來自 “ ITPUB博客 ” ,鏈接:http://blog.itpub.net/10294527/viewspace-125163/,如需轉載,請注明出處,否則將追究法律責任。

轉載于:http://blog.itpub.net/10294527/viewspace-125163/

總結

以上是生活随笔為你收集整理的用asp如何开发wap push(转)的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。