This code is working good in 3rd edition but its not working in 2nd edition if i post data i'm not getting any response from the server. i'm checking in device because in emulator its not connecting to network i have done all the network configuration..
i have enabled all the gprs settings but still i'm not getting any response from the server after the post.. plz somebody help me..
void CClientEngine::IssueHTTPPostL(const TDesC8& aUri,
const TDesC8& aContentType,
const TDesC8& aBody)
{
SetupConnectionL();
TUriParser8 uri;
uri.Parse(aUri);
delete iPostData;
iPostData = aBody.AllocL();
RStringF method = iSession.StringPool().StringF(HTTP::EPOST,
RHTTPSession::GetTable());
iTransaction = iSession.OpenTransactionL(uri, *this, method);
RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection();
SetHeaderL(hdr, HTTP::EUserAgent, KUserAgent);
SetHeaderL(hdr, HTTP::EAccept, KAccept);
SetHeaderL(hdr, HTTP::EContentType,KContentType);
MHTTPDataSupplier* dataSupplier = this;
iTransaction.Request().SetBody(*dataSupplier);
iTransaction.SubmitL();
iRunning = ETrue;
}
void CClientEngine::SetupConnectionL()
{
if( iConnectionSetupDone )
return;
iConnectionSetupDone = ETrue;
User::LeaveIfError(iSocketServ.Connect());
User::LeaveIfError(iConnection.Open(iSocketServ));
CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
CleanupStack::PushL(commDB);
CCommsDbConnectionPrefTableView* commDBView =
commDB->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionUnknown);
User::LeaveIfError(commDBView->GotoFirstRecord());
CCommsDbConnectionPrefTableView::TCommDbIapConnectionPref pref;
commDBView->ReadConnectionPreferenceL(pref);
TUint32 iapID = pref.iBearer.iIapId;
CleanupStack::PopAndDestroy(commDBView);
CleanupStack::PopAndDestroy(commDB);
TCommDbConnPref connectPref;
connectPref.SetDialogPreference(ECommDbDialogPrefDoNotPrompt);
connectPref.SetDirection(ECommDbConnectionDirectionUnknown);
connectPref.SetBearerSet(ECommDbBearerGPRS);
connectPref.SetIapId(iapID);
User::LeaveIfError(iConnection.Start(connectPref));
RStringPool strPool = iSession.StringPool();
RHTTPConnectionInfo connInfo = iSession.ConnectionInfo();
connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketServ,
RHTTPSession::GetTable() ), THTTPHdrVal (iSocketServ.Handle()) );
connInfo.SetPropertyL ( strPool.StringF(HTTP::EHttpSocketConnection,
RHTTPSession::GetTable() ),
THTTPHdrVal (REINTERPRET_CAST(TInt, &(iConnection))) );
}
if i run in emulator i'm getting this error -5120.
thanking you...





