×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Problem in Webservice Connection.

    Hi

    I am using following webservice for test SOAP Webservice from symbian s60.
    http://www.w3schools.com/webservices...nheitToCelsius

    I am also taking reference from S60 Addressbook example.

    But I am do not able to create connection getting error in following red highlighted colored lines.

    CONSTANS

    _LIT8(KPpContract,"urn:nokia:test:soap:2004-09");
    _LIT8(KQueryResponseLocalName, "FahrenheitToCelsiusResponse");
    _LIT8(KNsUri, "http://tempuri.org/");
    _LIT8(KASEndPoint, "http://www.w3schools.com/webservices/tempconvert.asmx/FahrenheitToCelsius");
    _LIT8(KASContract, "urn:liberty:as:2004-04");
    _LIT8(KASProviderID, "http://microsoft.com/webservices/"); //http://selma.ndhub.net:9080/tfs/");

    Code:
    AppUi
    void CInteropAppAppUi::HandleCommandL(TInt aCommand)
    	{
    	switch (aCommand)
    		{
    		case EAppConnect:
    			{
    			iReady = EFalse;
    			iConnecting = EFalse;
    			iWaitNote->ExecuteL(R_CONNECTING_NOTE, *this, ETrue);
    			iAppView->ShowAbout(EFalse);
    			}
    			break;
    		default:
    			Panic( EInteropAppUi);
    			break;
    		}
    	}
    
    AddressBookEngine.cpp
    void CAddressBookEngine::ConstructL()
    	{
    	CSenBaseFragment::BaseConstructL(KPpContract, KQueryResponseLocalName);
    	iXmlReader = CSenXmlReader::NewL();
    	}
    
    void CAddressBookEngine::ConnectL()
    	{
    	RegisterIdentityProviderL();
    
    	CSenXmlServiceDescription* pattern = CSenXmlServiceDescription::NewLC();
    	pattern->SetContractL(KPpContract());
    	delete iConnection;
    	iConnection = NULL;
    	iConnection = CSenServiceConnection::NewL(*this, *pattern);
    	CleanupStack::PopAndDestroy(pattern); 
    	}
    
    TInt CAddressBookEngine::RegisterIdentityProviderL()
    	{
    	TBuf<64> buf; // for logging
    	TInt retVal(KErrNone);
    
    	if (!iManager)
    		iManager = CSenServiceManager::NewL();
    
    	CSenIdentityProvider* idp = CSenIdentityProvider::NewLC(KASEndPoint, KASContract);
    
    	// Set the Provider ID
    	idp->SetProviderID(KASProviderID);
    
    	// Associate Forum Nokia's Addressbook service ID (contract) to this Identity Provider
    	idp->SetServiceID(KPpContract);
    
    	// Set Liberty ID-WSF framework ID
    	idp->SetFrameworkIdL(KDefaultIdWsfFrameworkID);
    
    	idp->SetUserInfoL(KNullDesC8, KNullDesC8, KNullDesC8);
    
    	retVal = iManager->RegisterIdentityProviderL(*idp);
    	if(retVal != KErrNone)
    		{
    		// --------------------------------------------------------------------
    		// An error occurred. However, the rest of registration calls will
    		// be attempted in order to provide any possible data that WSF needs.
    		// --------------------------------------------------------------------
    		buf.AppendNum(retVal);
    		buf.Zero();
    		}
    	retVal = iManager->RegisterServiceDescriptionL(*idp);
    	if(retVal != KErrNone)
    		{
    		buf.AppendNum(retVal);
    		buf.Zero();
    		}
    	CleanupStack::PopAndDestroy(idp); 
    	return retVal;
    	}
    
    AppUI
    void CInteropAppAppUi::ErrorL(TInt aCode)
    	{
    	_LIT(KNotReady, "Connection is not ready.");
    	_LIT(KTooManyMatches, "Too many search results, please refine your search.");
    	_LIT(KSearchFailed, "Internal error, please try again.");
    
    	iReady = ETrue;
    	CAknErrorNote* note = new (ELeave) CAknErrorNote(EFalse);
    	TBuf<70> errorMessage;
    	switch(aCode) 
    		{
    		case EConnectionNotReady:
    			errorMessage = KNotReady;
    			break;
    		case ESearchFailed:
    			errorMessage = KSearchFailed;
    			break;
    		default:
    			break;
    		}
    	note->ExecuteLD(errorMessage);
    	}
    Please help me in SOAP webservice for create connection, because I want to send request and receive response successfully.

    Regards,
    SymbianTH

  2. #2
    Regular Contributor
    Join Date
    Apr 2009
    Posts
    442

    Unhappy Re: Problem in Webservice Connection.

    Hi

    Please help me in symbian web service connectivity, please please.

    If I want to make web-service connection successfully than which value I set in following variable regarding following request.

    _LIT8(KPpContract,"");
    _LIT8(KQueryResponseLocalName, "");
    _LIT8(KNsUri, "");

    _LIT8(KASEndPoint, "");
    _LIT8(KTestAuthzID, "");
    _LIT8(KTestPassword, "");

    _LIT8(KASContract, "");
    _LIT8(KASProviderID, "");

    If my request is:
    SOAP 1.1

    Code:
    POST /webservices/tempconvert.asmx HTTP/1.1
    Host: www.w3schools.com
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    SOAPAction: "http://tempuri.org/FahrenheitToCelsius"
    
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <FahrenheitToCelsius xmlns="http://tempuri.org/">
          <Fahrenheit>string</Fahrenheit>
        </FahrenheitToCelsius>
      </soap:Body>
    </soap:Envelope>
    Response Like:
    Code:
    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8
    Content-Length: length
    
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <FahrenheitToCelsiusResponse xmlns="http://tempuri.org/">
          <FahrenheitToCelsiusResult>string</FahrenheitToCelsiusResult>
        </FahrenheitToCelsiusResponse>
      </soap:Body>
    </soap:Envelope>
    Regards,
    SymbianTH

Similar Threads

  1. webservice problem
    By koni_ka in forum Symbian Networking & Messaging (Closed)
    Replies: 8
    Last Post: 2009-05-14, 16:56
  2. WebService cancelling problem
    By nadav70 in forum Symbian Networking & Messaging (Closed)
    Replies: 6
    Last Post: 2009-03-03, 03:20
  3. WebService connection panic with N93 device
    By jufo in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2008-07-18, 11:31
  4. Problem with my 3220 Accessing Webservice
    By Joe_Black123 in forum Mobile Java Networking & Messaging & Security
    Replies: 2
    Last Post: 2005-07-11, 08:40

Posting Permissions

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