×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Sep 2007
    Posts
    62

    Web service, need a help

    Hi, im a biginer in programming in symbian
    please help me finished my first symbian application, im vary need it, i use nokia sdk 9.1 v 3

    im try developt a web service client, its very simply, it have 1 function a GetByPhone, its function must return a name of master of number phone, in this function i must set 1 parametr a phone number

    its like this - string GetByPhone(string _strPhoneNumber) (its function of web service, i try use it)

    i creat a web service in asp.net 2 and i want to connect him from my mobile

    im get a wsdl of my web service
    and created 3 cpp and 3 h files used a nokia wsdl-to-cpp tool

    after it insert this code into soft key click

    Code:
    _LIT8(KServiceEndpoint, "http://localhost:1108/HiDayPhoneDirectoryService/Service.asmx?wsdl");
       
        CSenXmlServiceDescription *pServiceDesc = CSenXmlServiceDescription::NewLC(KServiceEndpoint(), KNullDesC8());
    
        pServiceDesc->SetFrameworkIdL(KDefaultBasicWebServicesFrameworkID);
    
        CServiceCallback* pObserver =     CServiceCallback::NewLC();
     
        CServiceService* pService = CServiceService::NewLC(*pObserver,*pServiceDesc);
       
        RGetByPhone ParamGetByPhone;
        RGetByPhoneResponse result;
       
        ParamGetByPhone.i_strPhoneNamber=HBufC::NewL(100);
        _LIT(ddd,"111111111111");
        *(ParamGetByPhone.i_strPhoneNamber) =ddd; //set a param
        CSenSoapFault* fault = NULL;
       
        pService->GetByPhoneL(ParamGetByPhone,result,&fault); //request

    after request i get a error, error is KErrSenNotInitialized, i think i must wait a network connection, after it try do request

    but how it do, i dont know?

    i think i must implement a callback class

    Code:
    #include "ServiceCallback.h"
    
    
    CServiceCallback* CServiceCallback::NewL()
    {
        CServiceCallback* self = NewLC();
        CleanupStack::Pop(); // self
        return self;
    }
    
    
    CServiceCallback* CServiceCallback::NewLC()    
    {
        CServiceCallback* self = new (ELeave) CServiceCallback();
        CleanupStack::PushL(self);
        self->ConstructL();
        return self;
    }
    
    CServiceCallback::CServiceCallback()
    {
    }
    
    
    void CServiceCallback::ConstructL()
    {
    }
    
    
    CServiceCallback::~CServiceCallback()
    {
    }
    
    
    void CServiceCallback::HandleErrorL(const TInt /*aErrorCode*/, const TDesC8&  /*aError*/)
    {
        // TODO: Add your code here
    }
    
    
    void CServiceCallback::SetStatus(const TInt  aStatus)
    {
    
        // TODO: Add your code here
    
    //iConnection=aStatus;
    }
    
    
    void CServiceCallback::HandleGetByPhoneSoapOutL(const RGetByPhoneResponse&  /*aResponse*/)
    {
        // TODO: Add your code here
    }
    
    
    void CServiceCallback::HandleGetByAddressSoapOutL(const RGetByAddressResponse&  /*aResponse*/)
    {
        // TODO: Add your code here
    }

    help me please,thanks

  2. #2
    Registered User
    Join Date
    Oct 2006
    Posts
    8

    Re: Web service, need a help

    Hello,

    Yes, you must implement callback class, specifically SetStatus() function. When SetStatus() receives KSenConnectionStatusReady signal your CServiceService object is ready to use.

Similar Threads

  1. problem calling web service from j2me app
    By mmartins in forum Mobile Java Networking & Messaging & Security
    Replies: 4
    Last Post: 2010-04-23, 08:45
  2. KErrSenNotInitialized error while accessing web service, what am I doing wrong?
    By RaimondasL in forum Symbian Networking & Messaging (Closed)
    Replies: 8
    Last Post: 2007-06-14, 21:28
  3. 6680 and bluetooth service profiles
    By ceruault in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-08, 22:24
  4. strange web service behavior on 6680?
    By asidana in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2005-06-26, 17:09
  5. Web Service / Soap
    By corradoME in forum Mobile Java General
    Replies: 0
    Last Post: 2004-11-25, 11:21

Posting Permissions

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