websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTesterBlocks.cpp
branchRCL_3
changeset 20 f68f07157250
parent 0 62f9d29f7211
--- a/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTesterBlocks.cpp	Mon Jun 21 16:54:52 2010 +0300
+++ b/websrv_pub/xml_extensions_api/tsrc/bc/xml_extensions_api/src/WSTesterBlocks.cpp	Thu Jul 15 19:53:58 2010 +0300
@@ -248,6 +248,11 @@
 		{
 			// Test case not passed
 			iLog->Log(_L("Registering identity provider 1 failed. Error: %d"), error );
+			if(error == -30321)
+			{
+				iWriter.WriteL(_L8("Registering identity provider 1 failed. End-user denies permission."));
+				iWriter.CommitL();
+			}
 			return error;
 		}
         return KErrNone;
@@ -279,6 +284,11 @@
 	if (error != KErrNone )
 	{
 		iLog->Log(_L("Registering Service Description failed. Error: %d"), error );
+		if(error == -30321)
+		{
+			iWriter.WriteL(_L8("Registering Service Description failed.End-user denies permission"));
+			iWriter.CommitL();
+		}
 		return error;
 	}
     return KErrNone;
@@ -464,7 +474,7 @@
 
 	TInt retVal = iSenServiceConnection->StartTransaction();
 	
-	iLog->Log(_L("### _S_StartTransaction -> ended###"));
+	iLog->Log(_L("### _S_StartTransaction -> ended: %d"), retVal);
 	return retVal;
 }
 
@@ -474,7 +484,7 @@
 
 	TInt retVal = iSenServiceConnection->TransactionCompleted();
 	
-	iLog->Log(_L("### _S_TransactionCompleted -> ended###"));
+	iLog->Log(_L("### _S_TransactionCompleted -> ended: %d"), retVal);
 	return retVal;
 }
 
@@ -811,6 +821,13 @@
 					iStringPool.OpenStringL(KAttribute()),
 					iStringPool.OpenStringL(KAttributeValue())));
 
+		if (err != KErrNone) 
+			{
+			iLog->Log(_L("Retrieving the attribute failed. Error: %d"), err );
+			CleanupStack::PopAndDestroy();
+			return err;
+	    }
+
 			// make a new array for all attributes including namespace (to be added)
 			RAttributeArray justAttributes;
 
@@ -837,6 +854,13 @@
 					iStringPool.OpenStringL(KAttribute()),
 					iStringPool.OpenStringL(KAttributeValue())));
 
+		if (err != KErrNone) 
+			{
+			iLog->Log(_L("Retrieving the attribute failed. Error: %d"), err );
+			CleanupStack::PopAndDestroy();
+			return err;
+	    }
+
 			RAttributeArray justAttributes;
 			justAttributes.Append(justAttribute);
 
@@ -2105,7 +2129,7 @@
 
 	HBufC8* pTestXml = HBufC8::NewLC( xmlDoc.Length() );
 	pTestXml->Des().Append(xmlDoc);
-	CSenElement* newElement;
+	CSenElement* newElement = NULL;
 
 	//adding parsed document to SenElement and copy it to iElement
 
@@ -2255,20 +2279,20 @@
 	TBuf8<128> name;
 	name.Append(arg);
 
-	RAttributeArray apAttrs;
+	/*RAttributeArray apAttrs;
 
 	HBufC8* newAttr;
 
-	/*TRAPD(r, newAttr = ((CSenBaseElement*)iElement)->AllocAttrValueL(apAttrs, name) );
+	TRAPD(r, newAttr = ((CSenBaseElement*)iElement)->AllocAttrValueL(apAttrs, name) );
 	if (r != KErrNone) {
 		iLog->Log(_L("AllocAttrValueL failed. Error: %d"), r );
 		return r;
-	}*/
+	}
 
 	if ( newAttr!= NULL ){
         delete newAttr;
 	    newAttr = NULL;
-    }
+    }*/
 
 	iLog->Log(_L("******* _C_AllocAttrValue -> Ended! ********"));
 	return error;
@@ -2719,6 +2743,7 @@
 	{
 
 		iLog->Log(_L("******* SetStatus -> Started! ********"));
+		iLog->Log(_L("Status: %d"), aStatus);
 
 	switch( aStatus )
 		{
@@ -3005,7 +3030,7 @@
 		return error;
 	}
 //AsXML "UTF8"
-	HBufC8* pBuf;
+	HBufC8* pBuf = NULL;
 
 	TRAPD(rAsXml, pBuf = pDom->AsXmlL());
 	if (rAsXml != KErrNone)
@@ -3017,7 +3042,7 @@
 	iLog->Log(*pBuf);
 	LogResultL( *pBuf );
 //AsXMLUnicode
-    HBufC16* pBuf2;
+    HBufC16* pBuf2 = NULL;
 
 	TRAPD(rAsXmlUnicode, pBuf2 = pDom->AsXmlUnicodeL());
 	if (rAsXmlUnicode != KErrNone)
@@ -3083,7 +3108,7 @@
 	// close fsSession
 	CleanupStack::PopAndDestroy();
 	// Store parsed documed in file
-	HBufC8* pBuf;
+	HBufC8* pBuf = NULL;
 	// Convert document
 	TRAPD(rAsXml, pBuf = pDom->AsXmlL());
 	if (rAsXml != KErrNone)
@@ -3253,7 +3278,6 @@
 
 	HBufC8* pResult8 = HBufC8::NewLC( source8.Length() );
 	TPtr8 result8 = pResult8->Des();
-	iBase64Codec.Initialise();
 	iBase64Codec.Decode(source8	, result8);
 	aMessage = result8;
 	CleanupStack::Pop(); // pResult8