websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTesterBlocks.cpp
changeset 29 5743aa3a72c3
parent 28 0802db42e4e9
equal deleted inserted replaced
28:0802db42e4e9 29:5743aa3a72c3
   246 
   246 
   247 		if (error != KErrNone )
   247 		if (error != KErrNone )
   248 		{
   248 		{
   249 			// Test case not passed
   249 			// Test case not passed
   250 			iLog->Log(_L("Registering identity provider 1 failed. Error: %d"), error );
   250 			iLog->Log(_L("Registering identity provider 1 failed. Error: %d"), error );
       
   251 			if(error == -30321)
       
   252 			{
       
   253 				iWriter.WriteL(_L8("Registering identity provider 1 failed. End-user denies permission."));
       
   254 				iWriter.CommitL();
       
   255 			}
   251 			return error;
   256 			return error;
   252 		}
   257 		}
   253         return KErrNone;
   258         return KErrNone;
   254 }
   259 }
   255 TInt CWSTester::_S_UnregisterIdentityProvider( CStifItemParser& aItem ){
   260 TInt CWSTester::_S_UnregisterIdentityProvider( CStifItemParser& aItem ){
   277 	iLog->Log(_L("Registering Service Description"));
   282 	iLog->Log(_L("Registering Service Description"));
   278 	TInt error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
   283 	TInt error = iServiceManager->RegisterServiceDescriptionL( *iSenXmlServiceDescription);
   279 	if (error != KErrNone )
   284 	if (error != KErrNone )
   280 	{
   285 	{
   281 		iLog->Log(_L("Registering Service Description failed. Error: %d"), error );
   286 		iLog->Log(_L("Registering Service Description failed. Error: %d"), error );
       
   287 		if(error == -30321)
       
   288 		{
       
   289 			iWriter.WriteL(_L8("Registering Service Description failed.End-user denies permission"));
       
   290 			iWriter.CommitL();
       
   291 		}
   282 		return error;
   292 		return error;
   283 	}
   293 	}
   284     return KErrNone;
   294     return KErrNone;
   285 }
   295 }
   286 TInt CWSTester::_S_UnregisterServiceDescription( CStifItemParser& aItem ){
   296 TInt CWSTester::_S_UnregisterServiceDescription( CStifItemParser& aItem ){
   462 
   472 
   463 	iLog->Log(_L("### _S_StartTransaction -> started###"));
   473 	iLog->Log(_L("### _S_StartTransaction -> started###"));
   464 
   474 
   465 	TInt retVal = iSenServiceConnection->StartTransaction();
   475 	TInt retVal = iSenServiceConnection->StartTransaction();
   466 	
   476 	
   467 	iLog->Log(_L("### _S_StartTransaction -> ended###"));
   477 	iLog->Log(_L("### _S_StartTransaction -> ended: %d"), retVal);
   468 	return retVal;
   478 	return retVal;
   469 }
   479 }
   470 
   480 
   471 TInt CWSTester::_S_TransactionCompleted( CStifItemParser& aItem ) {
   481 TInt CWSTester::_S_TransactionCompleted( CStifItemParser& aItem ) {
   472 
   482 
   473 	iLog->Log(_L("### _S_TransactionCompleted -> started###"));
   483 	iLog->Log(_L("### _S_TransactionCompleted -> started###"));
   474 
   484 
   475 	TInt retVal = iSenServiceConnection->TransactionCompleted();
   485 	TInt retVal = iSenServiceConnection->TransactionCompleted();
   476 	
   486 	
   477 	iLog->Log(_L("### _S_TransactionCompleted -> ended###"));
   487 	iLog->Log(_L("### _S_TransactionCompleted -> ended: %d"), retVal);
   478 	return retVal;
   488 	return retVal;
   479 }
   489 }
   480 
   490 
   481 /*################################################
   491 /*################################################
   482 *
   492 *
  2731 	}
  2741 	}
  2732 void CWSTester::SetStatus(const TInt aStatus)
  2742 void CWSTester::SetStatus(const TInt aStatus)
  2733 	{
  2743 	{
  2734 
  2744 
  2735 		iLog->Log(_L("******* SetStatus -> Started! ********"));
  2745 		iLog->Log(_L("******* SetStatus -> Started! ********"));
       
  2746 		iLog->Log(_L("Status: %d"), aStatus);
  2736 
  2747 
  2737 	switch( aStatus )
  2748 	switch( aStatus )
  2738 		{
  2749 		{
  2739 		case 0: // new connection
  2750 		case 0: // new connection
  2740 			iLog->Log( _L("New Connection (status==0)" ));
  2751 			iLog->Log( _L("New Connection (status==0)" ));
  3265 	foundEnd = source8.Find(KEndData());
  3276 	foundEnd = source8.Find(KEndData());
  3266 	source8.Delete(foundEnd, source8.Length() - foundEnd );
  3277 	source8.Delete(foundEnd, source8.Length() - foundEnd );
  3267 
  3278 
  3268 	HBufC8* pResult8 = HBufC8::NewLC( source8.Length() );
  3279 	HBufC8* pResult8 = HBufC8::NewLC( source8.Length() );
  3269 	TPtr8 result8 = pResult8->Des();
  3280 	TPtr8 result8 = pResult8->Des();
  3270 	iBase64Codec.Initialise();
       
  3271 	iBase64Codec.Decode(source8	, result8);
  3281 	iBase64Codec.Decode(source8	, result8);
  3272 	aMessage = result8;
  3282 	aMessage = result8;
  3273 	CleanupStack::Pop(); // pResult8
  3283 	CleanupStack::Pop(); // pResult8
  3274 	CleanupStack::PopAndDestroy(); // pSource8
  3284 	CleanupStack::PopAndDestroy(); // pSource8
  3275 	return pResult8;
  3285 	return pResult8;