This page was last modified 04:45, 31 December 2007.
WAP Stack
From Forum Nokia Wiki
Contents |
Introduction
The WAP Stack uses the client/server framework. A single server provides WAP services which applications access through a client API.WAP server by itself refers to a remote server providing WAP content.The lowest level of the WAP protocol stack, the bearers, are implemented as plug-ins. SMS and IP are the standard bearers. There is no direct API to bearers.
Description
The API has five key concepts: Symbian WAP server, sub-session base class, WSP, and WDP.
Symbian WAP Server
The Symbian WAP server manages client access to WAP services.The client interface to the Symbian WAP server is provided by RWAPServ.
Sub-Session Base Class
The sub-session base class defines operations available on connections in all of WSP, WTP, and WDP. The sub-session base class is provided by RWAPConn.
WSP
WSP (Wireless Session Protocol) is the upper-level application layer of the WAP communications stack. Connection-orientated WSP is provided by RWSPCOConn. Supporting classes are CCapCodec, for capability negotiation, and RWSPCOTrans, which encapsulates an individual transaction. Connectionless WSP is provided by RWSPCLConn
WDP
WDP (Wireless Datagram Protocol) provides a general datagram transport service above the various data capable bearer services. WDP is provided by RWDPConn.
Sample Code
/* in class definition */ RWAPServ server; RWSPCOConn connection; RWSPCOTrans transaction; RWSPCOTrans event_tx; RWSPCOConn::TEvent event; /* in Connect() function */ User::LeaveIfError(server.Connect()); _LIT8(headers, ""); iCap = CCapCodec::NewL(); iCap->SetServerSDUSize(MAXSIZE+3000); iCap->SetClientSDUSize(MAXSIZE+3000); TBuf8<100> host; GetGwAddress(host); TInt port=9201; User::LeaveIfError(connection.Open(server, host, port, 0, EIP, EFalse)); User::LeaveIfError(connection.Connect(headers, iCap)); connection.GetEvent(event, event_tx, iStatus); SetActive();
void CWap::GetGwAddress(TDes8& addr) { bool found=false; CCommsDatabase* db; db=CCommsDatabase::NewL(EDatabaseTypeIAP); CleanupStack::PushL(db); CCommsDbTableView *view=db->OpenTableLC(TPtrC(WAP_IP_BEARER)); while (view->GotoNextRecord()==KErrNone) { TUint32 currid; view->ReadUintL(TPtrC(WAP_IAP), currid); if (currid==iIapId) { found=true; TBuf<100> tmp; view->ReadTextL(TPtrC(WAP_GATEWAY_ADDRESS), tmp); CC()->ConvertFromUnicode(addr, tmp); break; } } CleanupStack::PopAndDestroy(2); //db, view if (!found || !addr.Compare(_L8("0.0.0.0")) || addr.Length()==0) { User::Leave(-1004); } }
Download the WAP Stack example from here
Other Related Links
The Wireless Application Protocol
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to get Access to Private API | krishnaramram | General Symbian C++ | 5 | 2007-10-22 11:11 |
| Can't change stack size of the main GUI thread? | acclivity | General Symbian C++ | 3 | 2006-12-01 11:17 |
| 一个怪问题,定义了一个变量,编译就通不过了 | yunshiwo | Symbian | 5 | 2006-11-21 03:38 |
| unresolved external symbol __chkstk | asangamneheri | General Symbian C++ | 6 | 2003-10-17 08:08 |
| need greater stack size | shadow-2005 | General Symbian C++ | 3 | 2006-07-27 09:46 |
