×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    11

    Wap Download example in SDK 2 ?

    Hi,

    I developed an application implementing WAP Download in SDK 1 using the RWAPServ & RWSPCOConn etc... classes, they are deprecated in SDK 2.0 and removed in SDK 2.1. My question is how to implement a similar funcionallity in the recent SDKs ?

    RHTTPSession & RHTTPTransaction seem the way to go, but they seem quite complex and the only example I can find using them uses HTTP/TCPIP and I really need to use WAP.

    Anybody knows a WAP Download example working in SDK 2.1 ? Any tips ? Anyone facing similar problems ?

  2. #2
    Registered User
    Join Date
    Sep 2003
    Posts
    11
    Answering to my own query :

    It is not very dificult to transform the HTTP example provided by Nokia in a WAP application, just use :

    iSession.OpenL( _L8("WSP/WSP")

    intead of the default session open and inicialize the Wap related stuff :

    RHTTPConnectionInfo ci = iSession.ConnectionInfo();
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EHTTPVersion,RHTTPSession::GetTable()),THTTPHdrVal(iSession.StringPool().StringF(HTTP::EHttp10,RHTTPSession::GetTable())));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EProtocol,RHTTPSession::GetTable()),THTTPHdrVal(iSession.StringPool().StringF(HTTP::EWSP,RHTTPSession::GetTable())));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspBearer,RHTTPSession::GetTable()),THTTPHdrVal(iSession.StringPool().StringF(HTTP::EWspIp,RHTTPSession::GetTable())));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspProxyAddress,RHTTPSession::GetTable()),THTTPHdrVal(iSession.StringPool().OpenFStringL(KWapGateway)));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspLocalPort,RHTTPSession::GetTable()),THTTPHdrVal(KLocalPort));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspRemotePort,RHTTPSession::GetTable()),THTTPHdrVal(KRemotePort));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspCapClientMessageSize,RHTTPSession::GetTable()),THTTPHdrVal(100000));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspCapServerMessageSize,RHTTPSession::GetTable()),THTTPHdrVal(100000));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspSessionType,RHTTPSession::GetTable()),THTTPHdrVal(iSession.StringPool().StringF(HTTP::EWspConnectionOriented,RHTTPSession::GetTable())));

    iSession.ConnectL();

  3. #3
    Registered User
    Join Date
    Jul 2003
    Posts
    19
    can i know where can i find the http example u r talking about ?

  4. #4
    Regular Contributor
    Join Date
    Apr 2003
    Location
    Germany
    Posts
    94

  5. #5
    Regular Contributor
    Join Date
    Apr 2003
    Location
    Germany
    Posts
    94
    I'v tried using the RHttpSession class with "WSP/WSP" instead of "HTTP/TCP" as protocol. Therefore I modified the Nokia "HTTP example client" project.
    The strange thing is that the Access-Point dialog does not even show up. I also get no error or leave. Without the modifications the project runs fine.

    I tried it on a Nokia 6600 and 7610.

    Any helpful insights? There doesn't seem to be any documentation on this topic :(

    Thanks,
    Kalderas

    Modified example code:
    __________________

    void CClientEngine::ConstructL()
    {
    // Open RHTTPSession with default protocol ("HTTP/TCP")
    TRAPD(err, iSession.OpenL( _L8("WSP/WSP")));
    if(err != KErrNone) {
    // Most common error; no access point configured, and session creation
    // leaves with KErrNotFound.
    User::Leave(err);
    }

    unsigned l_U16_Port = 9201;
    TBuf8<16> l_TBuf8_GatewayIP = _L8( "193.254.160.3" );

    RHTTPConnectionInfo ci = iSession.ConnectionInfo();
    ci.SetPropertyL(iSession.StringPool( ).StringF(HTTP::EHTTPVersion,RHTTPSession::GetTable()), THTTPHdrVal(iSession.StringPool().StringF(HTTP::EHttp10,RHTTPSession::GetTable())));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EProtocol,RHTTPSession::GetTable()), THTTPHdrVal(iSession.StringPool().StringF(HTTP::EWSP,RHTTPSession::GetTable())));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspBearer,RHTTPSession::GetTable()), THTTPHdrVal(iSession.StringPool().StringF(HTTP::EWspIp,RHTTPSession::GetTable())));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspProxyAddress,RHTTPSession::GetTable()), THTTPHdrVal(iSession.StringPool().OpenFStringL( l_TBuf8_GatewayIP )));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspLocalPort,RHTTPSession::GetTable()), THTTPHdrVal( 0 ));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspRemotePort,RHTTPSession::GetTable()), THTTPHdrVal( l_U16_Port ));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspCapClientMessageSize, RHTTPSession::GetTable()), THTTPHdrVal( 100000 ));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspCapServerMessageSize, RHTTPSession::GetTable()), THTTPHdrVal( 100000 ));
    ci.SetPropertyL(iSession.StringPool().StringF(HTTP::EWspSessionType,RHTTPSession::GetTable()), THTTPHdrVal(iSession.StringPool().StringF(HTTP::EWspConnectionOriented,RHTTPSession::GetTable())));

    iSession.ConnectL( );

    InstallAuthenticationL(iSession);
    }

  6. #6
    Registered User
    Join Date
    Oct 2005
    Posts
    10

    Re: Wap Download example in SDK 2 ?

    Hi jcarlosr,

    i have tried using the code you suggested to transform nokia http example client but couldnt succeed. if you have a working wap client derived from the nokia exampleor anything that makes use of rhttpsession.......can you please share it with me..
    i need to use wap in my application and i am really stuck there. please please please help me. you will save my three months or work.
    Thank you,

    Regards,
    Praveen.

  7. #7
    Registered User
    Join Date
    Apr 2006
    Posts
    4

    Re: Wap Download example in SDK 2 ?

    Dear JCarlosR,

    Do you know how to use WAP on 6630 or 6680 using the RHTTPSession & RHTTPTransaction ??? Anyone knows??

  8. #8
    Regular Contributor
    Join Date
    Mar 2003
    Location
    Finland
    Posts
    224

    Thumbs up Re: Wap Download example in SDK 2 ?

    Hi,

    Making a WAP engine is bit difficult to accomplish as there are no organized document for this. Nokia's http client example is quite good to start up the process. That example is not working because of proxy installation part is missing there. Anyways I put the solution below, hope it may help you guys.

    It is best to use RHTTPSession over RConnection. It means it wouldn't be compatible with the previous SDK i.e. 1.2. RConnection is supported 2.0 onward. But using RConnection is the best to do, you will have more controll over the connection management. So I explain how to use RHTTPSession using RConnection. The following code may have typos.

    Code:
    #include <httpfilterproxyinterface.h> //CHttpFilterProxyInterface
    
    void ConstructL()
    {
    User::LeaveIfError(iSocketServ.Connect());
    User::LeaveIfError(iConnection.Open( iSocketServ ));
    iConnection.Start(); //Synchronous, so blocking here
    iHttpSession.OpenL();
    
    //There is a known bug for Nokia6630 for which automatic proxy configuration does not work
    //Manual proxy configuration is needed
    //Installing the automatic proxy configuration			
    CHttpFilterProxyInterface::InstallFilterL(iHttpSession);
    
    RHTTPConnectionInfo connInfo = iHttpSession.ConnectionInfo();	
    connInfo.SetPropertyL(iHttpSession.StringPool().StringF(HTTP::EHttpSocketServ,
    		      RHTTPSession::GetTable()), 
    		      THTTPHdrVal(iSocketServ.Handle()));
      		      // Attach to connection
    TInt connPtr = REINTERPRET_CAST(TInt, &iConnection);
    connInfo.SetPropertyL(iHttpSession.StringPool().StringF(HTTP::EHttpSocketConnection, RHTTPSession::GetTable()), THTTPHdrVal(connPtr));
    }
    
    //Use the Nokia's Http client example to make get or post request it will work
    
    void IssueHTTPGetL(const TDesC8& aUri)
    {
    TUriParser8 uri;
    uri.Parse(aUri);
    //Opening the transaction
    iTransaction = iHttpSession.OpenTransactionL(uri, *this, RStringF());
    RHTTPHeaders hdr = iTransaction.Request().GetHeaderCollection();
    //Depending on your needs, set http request header
    //SetHeaderL(hdr, HTTP::EAccept, KAccept);
    iTransaction.SubmitL(); //Asynchronous call for which MHFRunL(...) will be invoked
    }
    //The rest of the code is in Http example client to make a simple wap client


    Kalderas used hard coded proxy ip and port which in fact would not be the case for real implementation. The proxy info has to queried from CommDB which is another long story. Symbian OS developer seem to be changing their CommDB in every new release. So it is pretty hard to comply with that stuff. I had several posts on getting WAP proxy addr. and port. I have almost got it done except for Nokia6630. I have given also the solution for getting proxy which is working with all the devices except Nokia6630. Hope Nokia experts would put their thoughts someday.
    Regards,
    shagor

  9. #9
    Registered User
    Join Date
    Jun 2006
    Posts
    5

    Re: Wap Download example in SDK 2 ?

    hello!!!! is there someone here who know how to use the public/private key???????????

  10. #10
    Registered User
    Join Date
    Jul 2005
    Posts
    190

    Smile Re: Wap Download example in SDK 2 ?

    Thanks guys it worth a lot to me..!

    cheers

  11. #11
    Registered User
    Join Date
    May 2003
    Posts
    43

    Re: Wap Download example in SDK 2 ?

    Hi,
    I've been looking at WSP and have found that the following will not work:

    TRAPD(err, iSession.OpenL( _L8("WSP/WSP")));

    ...because the N70 (2.0537.1.7), 6630 (3.45.113) and other 6630 (2.39.129) all return -1 as the protocol doesn't appear to be available. Running RHTTPSession::ListAvailableProtocolsL on all devices only returns HTTP/TCP.

    I have also found that the InstallFilterL doesn't work for me though I see there are reports that on 6630 firmwares <4.x this causes a known panic. On all three devices the WAPSTKCLI.DLL is missing from the phone ROMs so I assume RWSPCOCon won't work so is there an interface for WSP over an RHTTPSession?

    I'm trying to get data through the VodaUK WAP proxy which I haven't got working using HTTP/TCP over an RHTTPSession whereas the VodaUK internet APN works as does the TMobileUK WAP APN and TMobileUK internet APN without referencing proxies (apart from in the IAP settings themselves). I'm accessing the TMobileUK WAP gateway without referencing the proxy which appears to work whereas using InstallFilterL on an N70 with the proxy settings explicitly set doesn't appear to work so I figured that in the case of VodaUK the network config blocks direct sockets from the WAP APN whereas TMobileUK doesn't block direct sockets through the WAP APN and the solution is to use WSP for a WAP APN if a proxy is specified so the same software will work in all cases?

    chris

Posting Permissions

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