Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
How to set up a connection through a wap proxy in Symbian C++
This article explains how to set up a connection through a wap proxy in Symbian C++.
Proxy number for wap network is listed in PROXIES table. Setting the proxy port number in not required for WAP1.0 therefore WAP_IP_BEARER table can contain a valid GatewayAddress with the ProxyPortNumber remain set as 0.
The default WAP server port is 9201 and most of the cases port are listed in the operators web page for the wap networks.
Using the http example provided with the SDK - SymbianSDKEpocRoot\Examples\AppProts\exampleclient\httpexampleclient.cpp, the following code can be used for set up a connection though a wap 1.0 gateway:
The member variables in the Header:
Opening the session and setting the gateway extracted from the WAP_IP_BEARER table:
_LIT8( KCodWspProtocol, "WSP/WSP" );
iSess.OpenL( KCodWspProtocol );
iSess.StringPool().OpenL( HttpFilterCommonStringsExt::GetTable() );
iGateway = iSess.StringPool().OpenFStringL( aGateway );
Configure the proxy port:
const TInt KWspRemotePort = 9201;
RHTTPConnectionInfo connInfo = iSess.ConnectionInfo();
connInfo.SetPropertyL( StringF( HTTP::EWspProxyAddress ), THTTPHdrVal( iGateway ) );
connInfo.SetPropertyL( StringF( HTTP::EWspRemotePort ), THTTPHdrVal( KWspRemotePort ) );
// Connect to WAP gateway.
iSess.SetSessionEventCallback( this );
Clean up after the session is disconnected: