wap(Wireless Application Protocol)入门部署设置及整理搜集了好多好多资料

整理了一些wap入门知识点,收集了一些wap网站学习资料

(一) 添加MIME映射,注册WAP页面类型文件

如何在IISMicrosoft Internet Information Server)上建立WAP网站

1.在IIS 平台创建一个新的MIME类型 先选择WAP站点的属性,再加入MIME类型,然后选择HTTP Headers标签。

MIME Map部分,点击File Type并且输入以下信息:

Associated Extension

MIME Type

wml

text/vnd.wap.wml

wmlc

application/vnd.wap.wmlc

wbmp

image/vnd.wap.wbmp

wmlsc

application/vnd.wap.wmlscriptc

wmls

text/vnd.wap.wmlscript

wsc

application/vnd.wap/wmlscriptc


完成以后,将会显示以下几种类型:

().IE浏览WAP页面.

如果您的IE不能正常浏览WAP,可能您的IE浏览器可能屏蔽了Activex技术。您可以设置IE浏览器属性。

  打开IE-->工具菜单-->Internet选项-->弹出对话框,如下图。选择安全选项卡,点击自定义级别,出现安全设置对话框,根据图2所示,选择启用,然后确定即可。
请参考下图:

1

<shape id="_x0000_i1028" style="WIDTH: 264.75pt; HEIGHT: 303.75pt" type="#_x0000_t75" alt=""></shape><imagedata o:href="http://www.hacker.cn/Files/BeyondPic/8d09ea750175257ede83c4376ab8f75c.gif" src="file:///C:/DOCUME~1/KING~1.ZHE/LOCALS~1/Temp/msohtml1/02/clip_image004.gif"></imagedata>

2

 ().强制输出WML格式,可供多种设备类型访问

强制输出WML:
web.config
添加下面内容<system.web>

1.
<browserCaps>
<resulttype="System.Web.Mobile.MobileCapabilities,System.Web.Mobile,Version=1.0.5000.0,Culture=neutral,PublicKeyToken=b<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="F" w:st="on"></chmetcnv>03f<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="5" unitname="F" w:st="on"></chmetcnv>5f<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="7" unitname="F" w:st="on"></chmetcnv>7f11d<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="50" unitname="a" w:st="on"></chmetcnv>50a<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="a" w:st="on"></chmetcnv>3a"/>
<usevar="HTTP_USER_AGENT"/>
preferredRenderingType="wml11"
preferredRenderingMime="text/vnd.wap.wml"
preferredImageMime="image/vnd.wap.wbmp"
</browserCaps>
2.
如果定义相关其它属性可以完整的移动设置属性:
<browserCaps>
<resulttype="System.Web.Mobile.MobileCapabilities,System.Web.Mobile,Version=1.0.5000.0,Culture=neutral,PublicKeyToken=b<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="F" w:st="on"></chmetcnv>03f<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="5" unitname="F" w:st="on"></chmetcnv>5f<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="7" unitname="F" w:st="on"></chmetcnv>7f11d<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="50" unitname="a" w:st="on"></chmetcnv>50a<chmetcnv tcsc="0" numbertype="1" negative="False" hasspace="False" sourcevalue="3" unitname="a" w:st="on"></chmetcnv>3a"/>
<usevar="HTTP_USER_AGENT"/>
browser=Unknown
version=0.0
majorversion=0
minorversion=0
frames=false
tables=false
cookies=false
backgroundsounds=false
vbscript=false
javascript=false
javaapplets=false
activexcontrols=false
win16=false
win32=false
beta=false
ak=false
sk=false
aol=false
crawler=false
cdf=false
gold=false
authenticodeupdate=false
tagwriter=System.Web.UI.Html32TextWriter
ecmascriptversion=0.0
msdomversion=0.0
w3cdomversion=0.0
platform=Unknown
css1=false
css2=false
xml=false
mobileDeviceManufacturer="Unknown"
mobileDeviceModel="Unknown"
gatewayVersion="None"
gatewayMajorVersion="0"
gatewayMinorVersion="0"
preferredRenderingType="wml11"
preferredRenderingMime="text/vnd.wap.wml"
preferredImageMime="image/vnd.wap.wbmp"
defaultScreenCharactersWidth="12"
defaultScreenCharactersHeight="6"
defaultScreenPixelsWidth="96"
defaultScreenPixelsHeight="72"
defaultCharacterWidth="8"
defaultCharacterHeight="12"
screenBitDepth="1"
isColor="false"
inputType="telephoneKeypad"
numberOfSoftkeys="0"
maximumSoftkeyLabelLength="5"
canInitiateVoiceCall="false"
canSendMail="true"
hasBackButton="true"
rendersWmlDoAcceptsInline="true"
rendersWmlSelectsAsMenuCards="true"
rendersBreaksAfterWmlAnchor="false"
rendersBreaksAfterWmlInput="false"
rendersBreakBeforeWmlSelectAndInput="true"
requiresAttributeColonSubstitution="true"
requiresPhoneNumbersAsPlainText="false"
requiresUrlEncodedPostfieldValues="false"
requiredMetaTagNameValue=""
rendersBreaksAfterHtmlLists="true"
requiresUniqueHtmlCheckboxNames="true"
requiresUniqueHtmlInputNames="true"
requiresUniqueFilePathSuffix="true"
supportsCss="false"
hidesRightAlignedMultiselectScrollbars="false"
canRenderAfterInputOrSelectElement="true"
canRenderInputAndSelectElementsTogether="true"
canRenderOneventAndPrevElementsTogether="true"
canCombineFormsInDeck="true"
canRenderMixedSelects="true"
canRenderPostBackCards="true"
canRenderSetvarZeroWithMultiSelectionList="true"
supportsImageSubmit="true"
supportsSelectMultiple="true"
requiresHtmlAdaptiveErrorReporting="false"
requiresContentTypeMetaTag="false"
requiresDBCSCharacter="false"
requiresOutputOptimization="false"
supportsAccesskeyAttribute="false"
supportsInputIStyle="false"
supportsInputMode="false"
supportsIModeSymbols="false"
supportsJPhoneSymbols="false"
supportsJPhoneMultiMediaAttributes="false"
maximumRenderedPageSize="2000"
requiresSpecialViewStateEncoding="false"
requiresNoBreakInFormatting="false"
requiresLeadingPageBreak="false"
supportsQueryStringInFormAction="true"
supportsCacheControlMetaTag="true"
supportsUncheck="true"
canRenderEmptySelects="true"
supportsRedirectWithCookie="true"
supportsEmptyStringInCookieValue="true"
cachesAllResponsesWithExpires="false"
requiresNoSoftkeyLabels="false"
defaultSubmitButtonLimit="1"
supportsBold="false"
supportsItalic="false"
supportsFontSize="false"
supportsFontName="false"
supportsFontColor="true"
supportsBodyColor="true"
supportsDivAlign="true"
supportsDivNoWrap="false"
supportsCharacterEntityEncoding="true"
isMobileDevice="false"
</browserCaps>

().WML

1XML程序的基本结构

一个简单的页面开始。

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.com/DTD/wml_1.1.xml"
>
<wml>
<card title="wap">
<p>Hello! </p>
</card>
</wml>

此程序在手机上显示Hello!

WML语言是一个很严格的,哪怕一点不同都会导致错误。所有的WML程序必须在文件的开头处声明XML文件类型,包括XML的版本,WML的文档类型、所用规范等。声明形式如下:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
"http://www.wapforum.com/DTD/wml_1.1.xml"
>

WML文档是由卡片(Card卡片组(Deck构成的,一个Deck是一个或多个Card的集合。当客户端发出请求之后,WML即从网络上把Deck发送到客户浏览器,这时用户就可以浏览Deck内包含的所有Card,而不必从网上单独下载每一个Card,程序中的第一个Card是缺省得可见的Card

<xml>标签:该标签用于包含和定义WML的一个Deck。它有一个可选的xmllang属性来制定文档的语言,比如<wml xml:lang="zh">表示文档语言为中文。

<card>标签:WML均使用<card></card>进行包含和定义。 <card>同时可以包含多个可选的属性,
:
<card id="name" title="label" newcontext="false" ordered="true" onenterforwand="url" pmemterbackward="url" ontimer="url"> </card>

().编程技巧

1.声明wml文件类型。这可采用ASPResponse对象,并将ContentType作为它的方法,书写时使用<%%>包含起来,格式为:

<% Response.ContentType="text/vnd.wap.wml" %>

2.

具体属性的意思可以考试MSDN:设备功能列表
ms-help://MS.MSDNQTR.2003FEB.2052/mwsdk/html/mwlrfDeviceCapabilitiesTable.htm

2.
链接:
在同一个aspx文件,使用Link控件的,#FORM来切换不同Form时在OPenWave5.0测试会出现错误!
建议在程序通过ActiveForm来做
3.
乱码:
如果在开发过程出现乱码,通过修改Web.Config
<globalization
requestEncoding="gb2312"
responseEncoding="gb2312"
/>
4.
取消移动设备缓存:
Page.Response.Expires=-1;
Response.CacheControl="Public";
5.
重定向
重定向通过
RedirectToMobilePage
函数
不过使用过程中可能会出现一些问题
建议用Link控件来代替

6. 获取手机Wallpaper尺寸: Size = Request("HTTP_X_UP_DEVCAP_SCREENPIXELS")'

7. 获取手机的型号:

str=request.ServerVariables("ALL_HTTP")
t=instr(1,str,"HTTP_USER_AGENT")+16
e=instr(t,str,"/")-t
Mobile_Type=mid(str,t,e)

8.获取真实手机号码

mobile=Request.ServerVariables("HTTP_X_UP_CALLING_LINE_ID")
mobile=mid(mobile,3,11)

()简单例子:

<?xml version="1.0"?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN"
  "http://www.wapforum.org/DTD/wml_1.1.xml">

<wml>
<card id="HELLO" title="HELLO">
 <p>
 Hello world!
 </p>
</card>
</wml>


显示结果如下:

------ HELLO ------



Hello World!

WML外部引用方式跟HTML相同

http://www.itsalon.net/index.wml
http://www.itsalon.net/index.wml#login


内部引用,如果next是当前DECK中的一个CARD时,可以用这种方式:

#next

提供链接功能的WML元素有2个:<go><anchor>.

().WAP术语

WAP——-- 无线应用协议WAP(Wireless Application Protocol)

WML------ (无线标记语言,为Java的一个扩展的子集)

WMLScrip- (WML脚本语言,为JavaScrip语言的一个扩展的子集)

WAE——-- WAP标准所定义的无线应用环境WAE(Wireless Application Environment)

WTA——WAP标准定义的无线电话应用WTA(Wireless Telephony Applications)

GSM——全球数字移动电话系统(Global System for Mobile communications)

CDMA——码分多路访问(Code Division Multiple Access)系统

TDMA----数字蜂窝移动通信系统

CDMA----Code Division Multiple Access,中文含义是码分多址

GPRS----(通用分组无线系统)

CDPD----(蜂窝数字分组数据网)

CSD-----(电路交换式数据网)

SMS-----(短消息服务)

WTA-----(电话业务)

WTAI----(WTA的编程接口)

WTAI----(无线电话应用接口)

WSP-----无线会晤协议(WSP)提供两类服务:面向连接的服务(工作于WTP之上)和无连接的服务(工作于WDP之上)

WTLS----无线会话协议

WTP---- 无线事务处理协议

WDP-----无线数据报协议

BlueTooth——指无线数据和话音传输的开放性标准

IIS--- 网际网络信息服务器

PWS--- 个人网页服务器

(八).相关开发资料链接:

http://msdn.microsoft.com/mobility/downloads/sdks/default.aspx

http://www.dotnet247.com/247reference/__site/72

http://www.wapease.com

http://www.sp-forum.org/download/list.asp?type=14

http://www2.chn.monternet.com:8080/devdownload/DevWapSimulator.jsp

http://www.tech-archive.net/Archive/DotNet/microsoft.public.dotnet.framework.aspnet.mobile/

http://www.411asp.net/home/tutorial/howto/wap

http://www.chinaunix.net/jh/26/15965.html
http://www.esofun.com/ceo/article.asp?id=1
http://www.cnblogs.com/aierong/archive/<chsdate w:st="on" isrocdate="False" islunardate="False" day="22" month="6" year="2005"></chsdate>2005/06/22/50279.html
http://www.xahz.com/Hzcommunication/ArticleInfo.asp?id=212
http://blog.93133.com/?action=show&id=166
http://www.mohappy.com/Soft/resources/spresource/200502/538.html

mobile:

1.http://www.microsoft.com/mobile/developer
2.http://mobility.microsoftdev.com
3.http://www.asp.net/mobile
4.http://www.microsoft.com/mobile/partner
5.http://www.microsoft.com/mobile/mobile2market
5.http://msdn.microsoft.com

特别推荐:

http://www.wapdotnet.com/HDLabTopicList.aspx?ForumID=9&Page=2

这个论坛不仅仅是一个论坛,还是一个wap开发知识宝库,有好多wap教程和wap(.net和非.net方面都有)

方面的源代码示例可以下载

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值