Discussion Board

Results 1 to 9 of 9
  1. #1
    Registered User RaimondasL's Avatar
    Join Date
    Aug 2006
    Posts
    10
    I am trying to get a program running that accesses a web service. I am using S60v3 MR SDK and running my program on emulator. I generated the skeleton code from WSDL (http://www.ignyte.com/webservices/ig...ions.asmx?wsdl) using web service code generation utility and wrote my code according to the tool usage manual. My code is:

    _LIT (KServiceEndpoint, "http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/moviefunctions.asmx");
    CSenXmlServiceDescription *pServiceDesc = CSenXmlServiceDescription::NewLC(KServiceEndpoint, KNullDesC8());
    pServiceDesc->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
    MovieCallback* pObserver = MovieCallback::NewLC();
    CMovieInformationService* pService = CMovieInformationService::NewLC(*pObserver,*pServiceDesc);

    RGetTheatersAndMoviesResponse result;
    RGetTheatersAndMovies param;
    _LIT(KZip,"01821");
    param.iZipCode = HBufC::NewL(100);
    *(param.iZipCode) = KZip;
    param.iRadius = 5;
    CSenSoapFault* fault = NULL;
    pService->GetTheatersAndMoviesL(param, result, &fault); // <--- this calls iConnection->SubmitL(*soapRequest, responseStr); where it gets the KErrSenNotInitialized error

    BTW, the emulator does not even show a warning about accessing web service and does not show "Access Point Selection" dialog that is shown during network accesses. However, the emulator accesses web fine, so it's not a network connection issue.

    I also succeeded to get the AddressBook web service example running - it also accesses web service fine in the emulator. Unfortunately, AddressBook uses different framework (Liberty/ID) and is overall too complex, so I can't use it to access the service above.

    Any suggestions would be appreciated.

    Raimondas

  2. #2
    Registered User RaimondasL's Avatar
    Join Date
    Aug 2006
    Posts
    10
    For anyone who might be interested, the issue was that after

    CMovieInformationService* pService = CMovieInformationService::NewLC(*pObserver,*pServiceDesc);

    the program needs to wait for SetStatus(KSenConnectionStatusReady) callback. It is an empty skeleton method that needs to be implemented in generated service callback file. This callback needs to occur before calling

    pService->GetTheatersAndMoviesL(param, result, &fault);

    Now my program works fine.

  3. #3
    Regular Contributor frizi's Avatar
    Join Date
    Feb 2006
    Location
    Slovakia
    Posts
    76
    i have the same problem. how do you wait for "SetStatus(KSenConnectionStatusReady) callback" ?

    Quote Originally Posted by RaimondasL
    For anyone who might be interested, the issue was that after

    CMovieInformationService* pService = CMovieInformationService::NewLC(*pObserver,*pServiceDesc);

    the program needs to wait for SetStatus(KSenConnectionStatusReady) callback. It is an empty skeleton method that needs to be implemented in generated service callback file. This callback needs to occur before calling

    pService->GetTheatersAndMoviesL(param, result, &fault);

    Now my program works fine.

  4. #4
    Registered User RaimondasL's Avatar
    Join Date
    Aug 2006
    Posts
    10
    Well, my solution was pretty much a hack, but here it is:

    In your web service callback, you set a flag:

    void YourWebServiceCallback::SetStatus(const TInt aStatus)
    {
    iConnectionState = aStatus;
    }

    In your app somehow now you wait for this flag to become set. I just had another command that user selected in menu:

    case EWebServiceCommand2:
    {
    if (pObserver->iConnectionState == KSenConnectionStatusReady)
    {
    // Do your stuff
    }
    }

    But you can use some other way to wait for a flag. Or maybe you can setup active object and send it message from callback.

  5. #5
    Regular Contributor frizi's Avatar
    Join Date
    Feb 2006
    Location
    Slovakia
    Posts
    76
    and does now emulator show warning about accessing web service and accesspoint dialog?

  6. #6
    Registered User RaimondasL's Avatar
    Join Date
    Aug 2006
    Posts
    10
    Sorry, I missed your message. Yes, I believe emulator should show a warning about accessing web service and access point dialog if you wait for callback.

    If I misunderstood your question, let me know.

  7. #7
    Registered User tham's Avatar
    Join Date
    May 2007
    Posts
    2
    Hi
    Its been some months since this conversation took place and I am hoping someone can help me with this same problem.

    I am trying to access a simple test calculator web service running on a local glassfish application server and I am getting the same KErrSenNotInitialized error. I have tried waiting for the SetStatus() callback as mentioned above but it never seems to be called.
    I also ran a packet sniffer (wireshark) and did not capture any packets from my client running on the emulator meaning there is no attempt to even establish the connection. However I can capture packets when using the browser on the emulator.

    My client also doesn't show any access point dialog or warning on accessing the web service.

    here is some sample code of my client:

    //inside the callback class
    void CCalculatorWSServiceServiceConsumer::SetStatus(const TInt aStatus)
    {
    iConn = aStatus;
    }

    //inside HandleCommandL()

    case EWSTest1Command1:

    CAknInformationNote * informationNote = new ( ELeave ) CAknInformationNote;
    _LIT8(KServEndpoint,"http://ipAddressOfServer/CalculatorWSService/CalculatorWS");
    pServiceDesc =CSenXmlServiceDescription::NewL(KServEndpoint);
    pServiceDesc->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
    pObserver = CCalculatorWSServiceServiceConsumer::NewLC();
    a.iI = 5;
    a.iJ = 6;

    pService = CCalculatorWSServiceService::NewLC(*pObserver,*pServiceDesc);
    break;



    case EWSTest1Command2:


    CAknInformationNote * informationNote1 = new ( ELeave ) CAknInformationNote;
    TRAPD(myError,result = pService->AddL(a));
    if(pObserver->iConn == KSenConnectionStatusReady)
    {
    if (myError == KErrSenSoapFault)
    {
    _LIT(KMyMessage,"Oh dear some error");
    informationNote1->ExecuteLD(KMyMessage);
    }
    else
    {
    TBuf<10> iString;

    iString.Num(result.iReturn);
    informationNote1->ExecuteLD(iString);
    }

  8. #8
    Regular Contributor frizi's Avatar
    Join Date
    Feb 2006
    Location
    Slovakia
    Posts
    76
    you must wait for (pObserver->iConn == KSenConnectionStatusReady) BEFORE calling pService->AddL(a)

    so it means
    1. pService = CCalculatorWSServiceService::NewLC(*pObserver,*pServiceDesc);
    2. wait for pObserver::SetStatus call (I use CActiveSchedulerWait for this)
    3. check pObserver->iConn == KSenConnectionStatusReady
    4. if ok, call pService->AddL(a) and after that you will see IAP selection dialog and packet traffic (you can use emulator->Tools->Diagnostics for watching traffic...)

  9. #9
    Registered User tham's Avatar
    Join Date
    May 2007
    Posts
    2
    I have have moved my if statement to before calling the web service method so it reads:

    case EWSTest1Command2:
    CAknInformationNote * informationNote1 = new ( ELeave ) CAknInformationNote;

    if(pObserver->iConn == KSenConnectionStatusReady)
    {
    TRAPD(myError,result = pService->AddL(a));
    ....

    However, I am still not getting the access point dialog or any sign of a connection ever being initialized.

Similar Threads

  1. 6680 and bluetooth service profiles
    By ceruault in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-08, 22:24
  2. strange web service behavior on 6680?
    By asidana in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-06-26, 17:09
  3. Web Service / Soap
    By corradoME in forum Mobile Java General
    Replies: 0
    Last Post: 2004-11-25, 11:21
  4. Calling web service under Symbian
    By tb337 in forum Symbian C++
    Replies: 0
    Last Post: 2003-11-30, 16:49
  5. .net web service & Nokia Card Phone 2.0
    By kfchong1 in forum PC Suite API and PC Connectivity SDK
    Replies: 1
    Last Post: 2003-02-23, 11:04

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved