×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    6

    Any tips - Web services on phone

    Firstly, I am a beginner at symbian (I have been persisting and don't generally ask for help) and have chosen visual studio & carbide & C++ due to my previous familiarity with C#. I have struggled over the last little while, but now have a successful web services application running on the emulator. But it doesn't work on my trial phone. There must be something I am missing as most of my application works (ie installs, runs, returns information from the phone and displays it on the phone) (background info), but when I run the connect menu item (which runs the top code fragment below) the IAP selection doesn't come up on the phone (though winsock does on the emulator). I am using basic web services and in order to check out the phone, I have complied several other applications which work.
    I have also built the addressbook sample application (which uses webservices) and installed it on the phone and it works correctly.

    The several differences between the address book and my webservice application are:
    1) I used the WSDL to C++ generator - the address book doesn't
    2) I installed the extra xmldatabinding.sis on my test phone (the address book doesn't use it)
    3) When I ran the addressbook application it prompted me to 'Allow application to subscribe to web service" which didn't happen for the WSDL to C++ generator version and then you select your access point. This didn't happen with the WSDL to c++ generated code.
    4) I use basic web services framework and the address book uses the liberty type with authentication.

    I have checked that the phone is able to get to the webservice (through browsing), so their is no connectivity limit, it can also do web services (through the address book app - so there are no certification issues), I can only think I am missing something.

    The code I am using you will all recognise (its all fairly standard) below:
    Where they are member variables of the active class (ie why no declaration). Firstly the connection:

    pServiceDesc = CSenXmlServiceDescription::NewLC(KServiceEndpoint, KNullDesC8());
    pServiceDesc->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
    pObserver = CNavMobServiceServiceConsumer::NewLC();
    pService = CNavMobServiceService::NewLC(*pObserver, *pServiceDesc);

    I have implemented the callback / error handler and get the right status with no errors and when the the connection is ready then calling the async method.

    pService->WebAsyncL(Webdata)

    If anyone has any time to give me a pointer in the right direction, it would be appreciated as it has had me baffled for 2 days now. The next step is a lot of debug windows popping up on the phone (which I have to work out how to do yet).

    Thanks for any help in advance,

    Ross.

  2. #2
    Regular Contributor
    Join Date
    Jun 2004
    Location
    Helsinki, Finland
    Posts
    69

    Re: Any tips - Web services on phone

    In which method you do your initialization stuff? This stuff
    ...
    pServiceDesc = CSenXmlServiceDescription::NewLC(KServiceEndpoint, KNullDesC8());
    ...

    that is. I mean if you do not give the control to the "system" the Active Object mechanism will not work.

    What I've done is a "proxy" -class which has ConstructL -method where certain initializations are done. Then I have separate ConnectL -method where I do these
    ...
    CSenXmlServiceDescription *pServiceDesc =
    CSenXmlServiceDescription::NewLC(CSettings::InstanceL(KSettingsUid)->Url(), KNullDesC8());

    pServiceDesc->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
    ...

    What I mean is you need to do your constructing and connecting in separate methods. You can try connecting only after your initialization has completed.

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    6

    Re: Any tips - Web services on phone

    Thanks for your reply myohol. Its good to see people helping each other. I was successfully checking the callback correctly and actually had a simple error of not having networkservices listed in my capability (mmp file). In the emulator its a configuration setting.

    I was kicking myself when remembered to check that, wishing I hadn't posted anything.

    Works beautifully now. Currently doing a second one that receives a response from my webservice. Which is interesting. There isn't a lot of doco out there about it, but it follows the same principles.

    Ross.

Similar Threads

  1. Building web services for N70
    By siumarco in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2007-07-27, 02:06
  2. 'services' vs 'web'
    By davidmaxwaterman in forum Symbian
    Replies: 13
    Last Post: 2007-05-29, 05:15
  3. N73: Web browser vs Services web browser
    By mfarooqkhan78 in forum Symbian Networking & Messaging (Closed)
    Replies: 1
    Last Post: 2006-11-15, 17:26
  4. HowTO: user agent fields and phone idenfication
    By alex_crowther in forum Browsing and Mark-ups
    Replies: 3
    Last Post: 2004-03-15, 05:06

Posting Permissions

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