×
Namespaces

Variants
Actions

How to set up a connection through a wap proxy in Symbian C++

From Nokia Developer Wiki
Jump to: navigation, search

This article explains how to set up a connection through a wap proxy in Symbian C++.

Article Metadata
Article
Created: Devnull (17 Nov 2011)
Last edited: hamishwillee (18 Nov 2011)


Introduction

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.

Summary

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:

RStringF iGateway; 
RHTTPSession iSess;

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 );
iSess.ConnectL();

Clean up after the session is disconnected:

iGateway.Close();
iSess.Close();
This page was last modified on 18 November 2011, at 03:39.
83 page views in the last 30 days.
×