×

Discussion Board

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    Registered User
    Join Date
    Feb 2008
    Location
    India
    Posts
    92

    How to find a working IAP which will successfully POST data ?

    Hi,
    My application is a background application in which I have to post data regularly after fixed interval of time.
    My problem is to select the working IAP of the current service provider which will successfully post the data.
    Currently, I am using the first IAP from the preferenceTable() which works most of the time but is not always guarenteed as sometimes it contains the IAP of the previous service provider in-case we change the SIM.

    So, I have the following queries :
    1. Is their a way to find the IAPs of the current ISP ?
    2. Out of the available IAPs which one is appropriate for posting data (as some IAPs like for MMS may have restrictions) ?
    3. Is WAP PUSH IAP
    [CCommsDatabase::GetGlobalSettingL(TPtrC(WAP_ACCESS_POINT),wap_id);]
    capable of posting data to a server ?

    or do I need to iterate through all the IAPs available in
    [CCommsDatabase::OpenIAPTableViewMatchingBearerSetLC(ECommDbBearerGPRS,ECommDbConnectionDirectionOutgoing);]
    and actually post a string to each of them and check the response to find the working IAP ?

    Thanks in advance,
    Suyash.

  2. #2
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Re: How to find a working IAP which will successfully POST data ?

    Quote Originally Posted by Suyash View Post
    Hi,
    My application is a background application in which I have to post data regularly after fixed interval of time.
    My problem is to select the working IAP of the current service provider which will successfully post the data.
    Currently, I am using the first IAP from the preferenceTable() which works most of the time but is not always guarenteed as sometimes it contains the IAP of the previous service provider in-case we change the SIM.

    So, I have the following queries :
    1. Is their a way to find the IAPs of the current ISP ?
    2. Out of the available IAPs which one is appropriate for posting data (as some IAPs like for MMS may have restrictions) ?
    3. Is WAP PUSH IAP
    [CCommsDatabase::GetGlobalSettingL(TPtrC(WAP_ACCESS_POINT),wap_id);]
    capable of posting data to a server ?

    or do I need to iterate through all the IAPs available in
    [CCommsDatabase::OpenIAPTableViewMatchingBearerSetLC(ECommDbBearerGPRS,ECommDbConnectionDirectionOutgoing);]
    and actually post a string to each of them and check the response to find the working IAP ?

    Thanks in advance,
    Suyash.
    Hello Suyash,

    I don't know how to find IAPs of the current ISP, but what about

    if we check that previous IAP is valid if not we can prompt user

    to select access id from acess point list.

    below here i am giving some code to check wheather your stored IAP is valid or not.

    void urclass::CheckValidAccessId()
    {
    TBufC<MAX_NET_LEN> commsdb_name_val(Your accessid name);
    CCommsDatabase* db = CCommsDatabase::NewL();
    CleanupStack::PushL(db);

    CCommsDbTableView* wapTable;
    wapTable = db->OpenViewMatchingTextLC ( TPtrC(IAP),
    TPtrC(COMMDB_NAME), commsdb_name_val );
    TInt resolveResult = KErrNone;
    resolveResult = wapTable->GotoFirstRecord() ;

    if(resolveResult == KErrNone)
    {
    wapTable->ReadUintL((TPtrC) COMMDB_ID, m_accessId );
    //store accessid

    m_configInfo.m_nAccessPoint = m_accessId;
    }
    else
    {
    Showaccesspointlist();
    ..................

    }

    CleanupStack::PopAndDestroy(2); // db, wapTable,
    }



    Thanks
    Last edited by kishore84; 2008-10-30 at 08:54.

  3. #3
    Registered User
    Join Date
    Feb 2008
    Location
    India
    Posts
    92

    Re: How to find a working IAP which will successfully POST data ?

    Hi kishore,
    Thanks for the reply.
    Yes, we can check the validity of AP, but as application runs in background and is completely hidden from the user we can't prompt the user for providing the IAP.
    Hence, in-case the IAP is not valid we need to find the valid IAP by ourselves programatically without any user intervention.

    Regards,
    Suyash.

  4. #4
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Re: How to find a working IAP which will successfully POST data ?

    so I think this type of situation can be handled by following ways

    1- We can take default AP(access point) of your device browser.

    2- we may search for particular AP in the list.

    3- we may read first record.

    From either of above method we can get AP and can connect without showing the AP list.

    For first case here below there is a link
    http://discussion.forum.nokia.com/fo...d.php?t=132777

    For 2nd case here below is some code

    TInt CConectionRequest::GetAcessId()
    {

    // open the IAP communications database
    CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(commDB);
    CCommsDbTableView* commDbTableView = commDB->OpenTableLC(TPtrC(IAP));
    CCommsDbConnectionPrefTableView* commDBView =
    commDB->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionOutgoing);
    TInt err;
    TBuf<128> iapName;
    // Point to the first entry
    if (commDBView->GotoFirstRecord() == KErrNone)
    {
    do
    {
    commDbTableView->ReadTextL(TPtrC(COMMDB_NAME), iapName);
    if(iapName.Compare(_L("yourdesiredapn(Airtellive(say))")) == 0)
    {
    commDbTableView->ReadUintL(TPtrC(COMMDB_ID), iapID);
    break;
    }

    err = commDbTableView->GotoNextRecord();
    } while (err == KErrNone);
    }

    CleanupStack::PopAndDestroy(commDBView);
    CleanupStack::PopAndDestroy(commDbTableView);
    CleanupStack::PopAndDestroy(commDB);
    return err;
    }

    For 3rd case I think you have the code.

    hope this will help you.

    Thanks

  5. #5
    Registered User
    Join Date
    Feb 2008
    Location
    India
    Posts
    92

    Re: How to find a working IAP which will successfully POST data ?

    OK,
    Actually, I want to use the 1st method ie. the default IAP, for which I am currently using the first (rank 1) record from "OpenConnectionPrefTableInRankOrderLC" but it will fail in some cases as you have also discussed in the post

    http://discussion.forum.nokia.com/fo...d.php?t=132777
    If we manually delete the IAP on rank-1, next time my application will try to connect to the same IAP and as it is invalid a pop up IAP selection prompt will come up (being a background app with no UI I can't afford to show IAP selection pop-up to the user).
    Similarly, the ranking is sometimes not updated in case of SIM change ie. the old SIMs operator IAP remains rank 1.

    So the main question remained unanswered in the above post :
    What changes the rank of "OpenConnectionPrefTableInRankOrderLC" ?
    [ If you know something about it, please explain it. ]


    Now, the wiki link for default IAP :
    http://wiki.forum.nokia.com/index.php/Default_iap

    In the following lines :
    TUint32 m_Iap=0;
    pref.SetIapId(m_Iap);

    They have taken 0 as the IAP_id and there is no IAP with IAP_id 0, how will it connect us to the defult IAP of the browser ?


    Regards,
    Suyash.

  6. #6
    Super Contributor
    Join Date
    Jul 2007
    Posts
    596

    Arrow Re: How to find a working IAP which will successfully POST data ?

    Hello Suyash,


    Sorry for late response,

    First thing we can set that dialog hidden but what you are telling that is right.Not only in that case but also If user select a wrong ap at browser it will be saved and in that case your app may not connect.(here atleast it should prompt for select proper apn).

    If it is a complete background aplication then I have no solution for that .

    Any body any suggestion.

    Thanks
    Last edited by kishore84; 2008-05-22 at 16:11.

  7. #7
    Registered User
    Join Date
    Feb 2008
    Location
    India
    Posts
    92

    Re: How to find a working IAP which will successfully POST data ?

    Hi all,

    APPROACH which WORKED:
    As my application is completely hidden and can't afford to have an IAP selection pop-up or any kind of user intervention so I iterated through all the available IAPs posting the data until I get a successfull acknowledgement.
    Then store this IAP in a permanent storage and used it in future until you get an error (like when sim is changed and IAP becomes invalid). In such case again iterate through all the available IAPs to get the correct one.

    In this way application becomes intelligent enough to find the correct IAP without any kind of user intervention and prompts (IAP selection pop-ups etc.) hence, working in background completely hidden from the user.


    Regards,
    Suyash.

  8. #8
    Regular Contributor
    Join Date
    Dec 2004
    Posts
    50

    Re: How to find a working IAP which will successfully POST data ?

    Hi Suyash,
    Here is the code which gives you Default IAP.

    TInt CClientHit::FindIAPL( TUint32& aIapId )
    {
    CCommsDatabase* iCommDb = CCommsDatabase::NewL();


    CCommsDbTableView* tableView = iCommDb->OpenTableLC( TPtrC( IAP ) );

    TUint32 iapId( 0 );
    TInt retval = tableView->GotoFirstRecord();

    while ( retval == KErrNone && iapId == 0 )
    {
    TBuf< KCommsDbSvrMaxFieldLength > serviceType;
    tableView->ReadTextL( TPtrC( IAP_SERVICE_TYPE ), serviceType );
    tableView->ReadUintL( TPtrC( COMMDB_ID ), iapId );

    TBuf<16>txt;
    txt.AppendNum((TInt)iapId);

    if ( serviceType.CompareF( TPtrC( OUTGOING_GPRS) ) == 0 )
    {
    aIapId = iapId;
    }
    retval = tableView->GotoNextRecord();
    }

    CleanupStack::PopAndDestroy( tableView );

    return ( iapId > 0 );
    }

    Regards,
    Vikas
    Mauj.

  9. #9
    Registered User
    Join Date
    Sep 2007
    Posts
    4

    Re: How to find a working IAP which will successfully POST data ?

    Hi Suyash,

    Iam looking for the same automatic looping for IAP selection.
    plz frovide me the code,it will be very useful to me.
    my id is rmethuku@gmail.com




    Quote Originally Posted by Suyash View Post
    Hi all,

    APPROACH which WORKED:
    As my application is completely hidden and can't afford to have an IAP selection pop-up or any kind of user intervention so I iterated through all the available IAPs posting the data until I get a successfull acknowledgement.
    Then store this IAP in a permanent storage and used it in future until you get an error (like when sim is changed and IAP becomes invalid). In such case again iterate through all the available IAPs to get the correct one.

    In this way application becomes intelligent enough to find the correct IAP without any kind of user intervention and prompts (IAP selection pop-ups etc.) hence, working in background completely hidden from the user.


    Regards,
    Suyash.

  10. #10
    Registered User
    Join Date
    Aug 2008
    Location
    India
    Posts
    39

    Re: How to find a working IAP which will successfully POST data ?

    Hi Suyash,

    I am developing a background application which has to store the working IAP for Connection.
    Can you plz provide me the looping code.
    my mail id is rakkeshyadav@gmail.com

    Thanks
    Rakesh
    Last edited by rakeshyadav; 2008-10-15 at 07:50. Reason: Change Mail Id

  11. #11
    Registered User
    Join Date
    Aug 2008
    Location
    India
    Posts
    39

    Re: How to find a working IAP which will successfully POST data ?

    Hi Suyash,

    I have iterated available IAPs and I am able to find the Correct one and store it for further use, now everytime I use that IAP. but If in future that IAP becomes Invalid (in case SIM is changed), then how to catch that condition.
    I mean to say how do I get to know that now its time to re-iterate the IAPs to get the Valid one or what type of error will i get if IAP becomes Invalid.

    Can you tell me the Logic you have tried ...

    Thanks

  12. #12
    Registered User
    Join Date
    Feb 2008
    Location
    India
    Posts
    92

    Re: How to find a working IAP which will successfully POST data ?

    Hi Rakesh,

    While iteration how do you come to know that a particular IAP has failed so continue to iterate or correct IAP has been found and the iteration needs to be stopped.
    The same method is to be used to decide re-iteration.

    Following are the cases I have considered:
    1. You get EFailed or any other error condition in MHFRunL (basically if you doesn't get ESucceded)
    2. If you doesn't get into MHFRunL() for a long time.
    For this I have selected a time out period after which I suspend the http transaction and move to the next IAP.

    Regards,
    Suyash.

  13. #13
    Registered User
    Join Date
    Aug 2008
    Location
    India
    Posts
    39

    App Closed E32USER-CBase 71

    Hi Suyash,

    Thanks for your suggestions.

    I am facing another problem now . The IAP selection code is working fine alone but when I Integrate and run it with my Background Sync Application it starts, select IAP and closes itself giving Panic "App Closed E32USER-CBase 71 ".
    This Panic comes after adding the IAP selection code. I am not able to Debug as Sync API is used. I have tried to resolve it but can't..

    Here is that code snippet, If anyone could point any error..

    // open the IAP communications database
    CCommsDatabase* commDB = CCommsDatabase::NewL(EDatabaseTypeIAP);
    CleanupStack::PushL(commDB);
    CCommsDbTableView* commDbTableView = commDB->OpenTableLC(TPtrC(IAP));
    CleanupStack::PushL(commDbTableView);
    CCommsDbConnectionPrefTableView* commDBView =
    commDB->OpenConnectionPrefTableInRankOrderLC(ECommDbConnectionDirectionOutgoing);
    CleanupStack::PushL(commDBView);

    TInt err;
    TBuf<128> iapName;
    TUint32 aIap;
    TBool valid = EFalse;
    // Point to the first entry
    if (commDBView->GotoFirstRecord() == KErrNone)
    {
    do
    {
    TBuf< KCommsDbSvrMaxFieldLength > serviceType;
    commDbTableView->ReadTextL(TPtrC(COMMDB_NAME), iapName);
    commDbTableView->ReadTextL( TPtrC( IAP_SERVICE_TYPE ), serviceType );
    if ( serviceType.CompareF( TPtrC( OUTGOING_GPRS) ) == 0 )
    {
    //CEikonEnv::InfoWinL(_L("Connecting for..."),iapName);

    //gettng IAP
    commDbTableView->ReadUintL(TPtrC(COMMDB_ID), aIap);

    iIapId = aIap;

    //checking If connection can be made using thisIAP
    valid = MakeConnection(iIapId);
    if(valid)
    {
    break;
    }
    }
    err = commDbTableView->GotoNextRecord();

    } while (err == KErrNone && valid ==EFalse);
    }

    CleanupStack::PopAndDestroy(3);
    //CleanupStack::PopAndDestroy(commDBView);
    //CleanupStack::PopAndDestroy(commDbTableView);
    //CleanupStack::PopAndDestroy(commDB);



    Thanks in Advance
    Rakesh

  14. #14
    Registered User
    Join Date
    Feb 2008
    Location
    India
    Posts
    92

    Re: How to find a working IAP which will successfully POST data ?

    Hi Rakesh,

    E32USER-CBase 71 refers to "This panic is raised when TRAPs have been nested and an attempt is made to exit from a TRAP nest level before all the cleanup items belonging to that level have been popped off the cleanup stack."

    So the problem doesn't seem to be in the below provided code.
    You can check the code execution flow and "TRAP" statements you have given.

    For panic code definitions below is the link:
    http://www.symbian.com/Developer/tec...32user%2dcbase

    Regards,
    Suyash.

  15. #15
    Registered User
    Join Date
    Aug 2008
    Location
    India
    Posts
    39

    Re: How to find a working IAP which will successfully POST data ?

    Hi Suyash,

    Thanks for reply.
    Issue is resolved. I watch up CleanupStack a bit carefully which paid off.

    Regards
    Rakesh

Similar Threads

  1. J2ME encrypt C# decrypt
    By josual in forum Mobile Java Networking & Messaging & Security
    Replies: 13
    Last Post: 2008-10-20, 04:29
  2. Replies: 3
    Last Post: 2008-09-09, 04:53
  3. How to find out the outgoing SMS data size and SMS count
    By chavasekhar in forum Symbian Networking & Messaging (Closed)
    Replies: 3
    Last Post: 2008-09-02, 08:29
  4. Receiving data form HTTP POST
    By kenpo in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2007-07-08, 09:42
  5. HTTP POST, sending data, any idea how to fetch in PHP?
    By imarenic in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2003-11-13, 21:05

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×