webservices/wsutils/src/senhttptransportproperties.cpp
changeset 0 62f9d29f7211
equal deleted inserted replaced
-1:000000000000 0:62f9d29f7211
       
     1 /*
       
     2 * Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:      
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 #include <s32strm.h> // RWriteStream
       
    26 #include <SenXmlReader.h>
       
    27 #include <SenXmlUtils.h>
       
    28 #include <SenBaseAttribute.h>
       
    29 #include <SenXmlConstants.h>
       
    30 
       
    31 #include "senlogger.h"
       
    32 #include "SenHttpTransportProperties.h"
       
    33 #include "senpropertiesfragment.h"
       
    34 #include "MSenProperty.h"
       
    35 
       
    36 EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewL()
       
    37     {
       
    38     CSenHttpTransportProperties* pNew = NewLC();
       
    39     CleanupStack::Pop(); // pNew
       
    40     return pNew;
       
    41     }
       
    42 
       
    43 EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewLC()
       
    44     {
       
    45     CSenHttpTransportProperties* pNew = new (ELeave) CSenHttpTransportProperties;
       
    46     CleanupStack::PushL(pNew);
       
    47 
       
    48     // omit parsing by passing zero-length descriptor
       
    49     pNew->BaseConstructL(KSenXmlPropertiesLocalname,
       
    50                          KNullDesC8,
       
    51                          NULL);
       
    52     return pNew;
       
    53     }
       
    54 
       
    55 EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewL(const TDesC8& aXmlUtf8,
       
    56                                                                CSenXmlReader& aParser)
       
    57     {
       
    58     CSenHttpTransportProperties* pNew = NewLC(aXmlUtf8, aParser);
       
    59     CleanupStack::Pop(); // pNew
       
    60     return pNew;
       
    61     }
       
    62 
       
    63 EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewLC(const TDesC8& aXmlUtf8,
       
    64                                                                 CSenXmlReader& aParser)
       
    65     {
       
    66     CSenHttpTransportProperties* pNew = new (ELeave) CSenHttpTransportProperties;
       
    67     CleanupStack::PushL(pNew);
       
    68 
       
    69     // parse the XML document  descriptor into DOM fragment
       
    70     pNew->BaseConstructL(KSenXmlPropertiesLocalname,
       
    71                          aXmlUtf8,
       
    72                          &aParser);
       
    73     return pNew;
       
    74     }
       
    75 
       
    76 EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewL(const CSenElement& aElement)
       
    77     {
       
    78     CSenHttpTransportProperties* pNew = NewLC(aElement);
       
    79     CleanupStack::Pop(); // pNew
       
    80     return pNew;
       
    81     }
       
    82 
       
    83 EXPORT_C CSenHttpTransportProperties* CSenHttpTransportProperties::NewLC(const CSenElement& aElement)
       
    84     {
       
    85     CSenHttpTransportProperties* pNew = new (ELeave) CSenHttpTransportProperties;
       
    86     CleanupStack::PushL(pNew);
       
    87 
       
    88     // parse the XML document  descriptor into DOM fragment
       
    89     pNew->BaseConstructL(aElement);
       
    90     return pNew;
       
    91     }
       
    92 
       
    93 void CSenHttpTransportProperties::SetReader(CSenXmlReader& aReader)
       
    94     {
       
    95     CSenTransportProperties::SetReader(aReader);
       
    96     } 
       
    97 
       
    98 MSenProperties::TSenPropertiesClassType CSenHttpTransportProperties::PropertiesClassType() 
       
    99     {
       
   100     return ESenHttpTransportProperties;
       
   101     }
       
   102 
       
   103 void CSenHttpTransportProperties::WriteToL(RWriteStream& aWriteStream)
       
   104     {
       
   105     CSenTransportProperties::WriteToL(aWriteStream);
       
   106     }
       
   107     
       
   108 void CSenHttpTransportProperties::ReadFromL(const TDesC8& aBuffer)
       
   109     {
       
   110     CSenTransportProperties::ReadFromL(aBuffer);
       
   111     }    
       
   112 
       
   113 HBufC8* CSenHttpTransportProperties::AsUtf8L()
       
   114     {
       
   115     return CSenTransportProperties::AsUtf8L();
       
   116     }
       
   117 
       
   118 HBufC8* CSenHttpTransportProperties::AsUtf8LC()
       
   119     {
       
   120     return CSenTransportProperties::AsUtf8LC();
       
   121     }
       
   122     
       
   123 TBool CSenHttpTransportProperties::IsSafeToCast(TSenPropertiesClassType aClass)
       
   124     {
       
   125     if ( aClass == MSenProperties::ESenHttpTransportProperties )
       
   126         {
       
   127         return ETrue;
       
   128         }
       
   129     else
       
   130         {
       
   131         return CSenTransportProperties::IsSafeToCast(aClass);
       
   132         }
       
   133     }      
       
   134     
       
   135     
       
   136 TInt CSenHttpTransportProperties::SetPropertyL(const TDesC8& aName,
       
   137                                                const TDesC8& aValue)
       
   138     {
       
   139     return CSenTransportProperties::SetPropertyL(aName, aValue);
       
   140     }
       
   141     
       
   142 TInt CSenHttpTransportProperties::PropertyL(const TDesC8& aName,
       
   143                                             TPtrC8& aValue)
       
   144     {
       
   145     return CSenTransportProperties::PropertyL(aName, aValue);
       
   146     }
       
   147     
       
   148 TInt CSenHttpTransportProperties::SetIntPropertyL(const TDesC8& aName,
       
   149                                                   const TInt aValue)
       
   150     {
       
   151     return CSenTransportProperties::SetIntPropertyL(aName, aValue);
       
   152     }
       
   153 
       
   154 TInt CSenHttpTransportProperties::IntPropertyL(const TDesC8& aName,
       
   155                                                TInt& aValue)
       
   156     {
       
   157     return CSenTransportProperties::IntPropertyL(aName, aValue);
       
   158     }
       
   159 
       
   160 TInt CSenHttpTransportProperties::SetBoolPropertyL(const TDesC8& aName,
       
   161                                                    const TBool aValue)
       
   162     {
       
   163     return CSenTransportProperties::SetBoolPropertyL(aName, aValue);
       
   164     }
       
   165 
       
   166 TInt CSenHttpTransportProperties::BoolPropertyL(const TDesC8& aName,
       
   167                                                 TBool& aValue)
       
   168     {
       
   169     return CSenTransportProperties::BoolPropertyL(aName, aValue);
       
   170     }  
       
   171 
       
   172 TInt CSenHttpTransportProperties::SetOmittedL(const TDesC8& aName, TBool aValue)
       
   173     {
       
   174     return CSenTransportProperties::SetOmittedL(aName, aValue);
       
   175     }
       
   176 
       
   177 TInt CSenHttpTransportProperties::RemovePropertyL(const TDesC8& aName)
       
   178     {
       
   179     return CSenTransportProperties::RemovePropertyL(aName);
       
   180     }
       
   181 
       
   182 CSenHttpTransportProperties::~CSenHttpTransportProperties()
       
   183     {
       
   184     }
       
   185 
       
   186 void CSenHttpTransportProperties::BaseConstructL(const TDesC8& aLocalname, 
       
   187                                                  const TDesC8& aXml,
       
   188                                                  CSenXmlReader* aParser)
       
   189     {
       
   190     CSenTransportProperties::BaseConstructL(aLocalname, aXml, aParser);
       
   191     }
       
   192 
       
   193 void CSenHttpTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
       
   194                                                  const TDesC8& aLocalname, 
       
   195                                                  const TDesC8& aXml,
       
   196                                                  CSenXmlReader* aParser)
       
   197     {
       
   198     CSenTransportProperties::BaseConstructL(aNamespace, aLocalname, aXml, aParser);
       
   199     }
       
   200 
       
   201 void CSenHttpTransportProperties::BaseConstructL(const TDesC8& aNamespace, 
       
   202                                                  const TDesC8& aLocalname, 
       
   203                                                  const TDesC8& aQualifiedName, 
       
   204                                                  const TDesC8& aXml,
       
   205                                                  CSenXmlReader* aParser)
       
   206     {
       
   207     CSenTransportProperties::BaseConstructL(aNamespace, aLocalname, aQualifiedName, aXml, aParser);
       
   208     }
       
   209 
       
   210 void CSenHttpTransportProperties::BaseConstructL(const CSenElement& aElement)
       
   211     {
       
   212     CSenTransportProperties::BaseConstructL(aElement);
       
   213     }
       
   214 
       
   215 CSenHttpTransportProperties::CSenHttpTransportProperties()
       
   216     {
       
   217     }
       
   218 
       
   219 
       
   220 TInt CSenHttpTransportProperties::ContentTypeL(TPtrC8& aContentType)
       
   221     {
       
   222     return HttpHeaderL(KContentTypeLocalName, aContentType);
       
   223     }
       
   224 
       
   225 void CSenHttpTransportProperties::SetContentTypeL(const TDesC8& aContentType)
       
   226     {
       
   227     SetPropertyL(KContentTypeLocalName, aContentType, KHttpHeaderType);
       
   228     }
       
   229 
       
   230 TInt CSenHttpTransportProperties::UserAgentL(TPtrC8& aUserAgent)
       
   231     {
       
   232     return HttpHeaderL(KUserAgentLocalName, aUserAgent);
       
   233     }
       
   234 
       
   235 void CSenHttpTransportProperties::SetUserAgentL(const TDesC8& aUserAgent)
       
   236     {
       
   237     SetPropertyL(KUserAgentLocalName, aUserAgent, KHttpHeaderType);
       
   238     }
       
   239 
       
   240         
       
   241 TInt CSenHttpTransportProperties::SoapActionL(TPtrC8& aSoapAction)
       
   242     {
       
   243     return CSenTransportProperties::SoapActionL(aSoapAction);
       
   244     }
       
   245 
       
   246 void CSenHttpTransportProperties::SetSoapActionL(const TDesC8& aSoapAction)
       
   247     {
       
   248     _LIT8(KQuote, "\"");
       
   249     HBufC8* pTemp = HBufC8::NewLC(aSoapAction.Length()+(2*KQuote().Length()));  
       
   250 
       
   251     TPtr8 temp = pTemp->Des();
       
   252 
       
   253     if(!SenXmlUtils::StartsWith(aSoapAction, KQuote))
       
   254         {
       
   255         temp.Append(KQuote);
       
   256         }
       
   257     temp.Append(aSoapAction);
       
   258 
       
   259     if(!SenXmlUtils::EndsWith(*pTemp, KQuote))
       
   260         {
       
   261         temp.Append(KQuote);
       
   262         }
       
   263 
       
   264     SetPropertyL(KSoapActionLocalName, *pTemp, KHttpHeaderType);
       
   265 
       
   266     CleanupStack::PopAndDestroy(pTemp); // Destroy temporary SoapAction
       
   267 	}
       
   268 
       
   269 TInt CSenHttpTransportProperties::AcceptL(TPtrC8& aAccept)
       
   270     {
       
   271     return HttpHeaderL(KAcceptLocalName, aAccept);    
       
   272     }
       
   273 
       
   274 void CSenHttpTransportProperties::SetAcceptL(const TDesC8& aAccept)
       
   275     {
       
   276     SetPropertyL(KAcceptLocalName, aAccept, KHttpHeaderType);
       
   277     }
       
   278         
       
   279 TInt CSenHttpTransportProperties::HttpMethodL(TSenHttpMethod& aMethod)
       
   280     {
       
   281     TPtrC8 method;
       
   282     TInt retVal = PropertyL(KHttpMethodLocalName, method);
       
   283     if (retVal == KErrNone)
       
   284         {
       
   285         if (method == KHttpGet)
       
   286             {
       
   287             aMethod = ESenHttpGet;
       
   288             return KErrNone;
       
   289             }
       
   290         else if (method == KHttpPost)
       
   291             {
       
   292             aMethod = ESenHttpPost;
       
   293             return KErrNone;
       
   294             }
       
   295         else if (method == KHttpPut)
       
   296             {
       
   297             aMethod = ESenHttpPut;
       
   298             return KErrNone;
       
   299             }
       
   300         else if (method == KHttpDelete)
       
   301             {
       
   302             aMethod = ESenHttpDelete;
       
   303             return KErrNone;
       
   304             }
       
   305         else
       
   306             {
       
   307             return KErrUnknown;
       
   308             }
       
   309         }
       
   310     else
       
   311         {
       
   312         return retVal;
       
   313         }
       
   314     }
       
   315 
       
   316 void CSenHttpTransportProperties::SetHttpMethodL(TSenHttpMethod aHttpMethod)
       
   317     {
       
   318     switch ( aHttpMethod )
       
   319         {
       
   320         case ESenHttpGet:
       
   321             SetPropertyL(KHttpMethodLocalName, KHttpGet);
       
   322             break;
       
   323         case ESenHttpPost:
       
   324             SetPropertyL(KHttpMethodLocalName, KHttpPost);
       
   325             break;
       
   326         case ESenHttpPut:
       
   327             SetPropertyL(KHttpMethodLocalName, KHttpPut);
       
   328             break;
       
   329         case ESenHttpDelete:
       
   330             SetPropertyL(KHttpMethodLocalName, KHttpDelete);
       
   331             break;
       
   332         default:
       
   333             // Not possible
       
   334             break;
       
   335         }
       
   336     }
       
   337 
       
   338 TInt CSenHttpTransportProperties::HttpVersionL(TSenHttpVersion& aHttpVersion)
       
   339     {
       
   340     TPtrC8 method;
       
   341     TInt retVal = PropertyL(KHttpVersionLocalName, method);
       
   342     if (retVal == KErrNone)
       
   343         {
       
   344         if (method == KHttp10)
       
   345             {
       
   346             aHttpVersion = ESenHttp10;
       
   347             return KErrNone;
       
   348             }
       
   349         else if (method == KHttp11)
       
   350             {
       
   351             aHttpVersion = ESenHttp11;
       
   352             return KErrNone;
       
   353             }
       
   354         else
       
   355             {
       
   356             return KErrUnknown;
       
   357             }
       
   358         }
       
   359     else
       
   360         {
       
   361         return retVal;
       
   362         }
       
   363     }
       
   364 
       
   365 void CSenHttpTransportProperties::SetHttpVersionL(TSenHttpVersion aHttpVersion)
       
   366     {
       
   367     switch ( aHttpVersion )
       
   368         {
       
   369         case ESenHttp10:
       
   370             SetPropertyL(KHttpVersionLocalName, KHttp10);
       
   371             break;
       
   372         case ESenHttp11:
       
   373             SetPropertyL(KHttpVersionLocalName, KHttp11);
       
   374             break;
       
   375         default:
       
   376             // Not possible
       
   377             break;
       
   378         }
       
   379     }
       
   380 
       
   381 TInt CSenHttpTransportProperties::HttpHeaderL(const TDesC8& aHeaderName,
       
   382                                                 TPtrC8& aValue)
       
   383     {
       
   384     TPtrC8 value;
       
   385     TPtrC8 type;
       
   386     TInt retVal = PropertyL(aHeaderName, value, type);
       
   387     if ( retVal == KErrNone )
       
   388         {
       
   389         if ( type == KHttpHeaderType )
       
   390             {
       
   391             aValue.Set(value);
       
   392             }
       
   393         else
       
   394             {
       
   395             retVal = KErrNotFound;
       
   396             }
       
   397         }
       
   398     return retVal;
       
   399     }
       
   400         
       
   401 void CSenHttpTransportProperties::SetHttpHeaderL(const TDesC8& aHeaderName, const TDesC8& aValue)
       
   402     {
       
   403     SetPropertyL(aHeaderName, aValue, KHttpHeaderType);
       
   404     }
       
   405 
       
   406 TInt CSenHttpTransportProperties::SetPropertyL(const TDesC8& aName,
       
   407                                                const TDesC8& aValue,
       
   408                                                const TDesC8& aType)
       
   409     {
       
   410     return CSenTransportProperties::SetPropertyL(aName, aValue, aType);
       
   411     }
       
   412 
       
   413 TInt CSenHttpTransportProperties::PropertyL(const TDesC8& aName,
       
   414                                             TPtrC8& aValue,
       
   415                                             TPtrC8& aType)
       
   416     {
       
   417     return CSenTransportProperties::PropertyL(aName, aValue, aType);
       
   418     }
       
   419 
       
   420 TInt CSenHttpTransportProperties::IapIdL(TUint32& aCurrentIapId)
       
   421     {
       
   422     return CSenTransportProperties::IapIdL(aCurrentIapId);
       
   423     }
       
   424 
       
   425 void CSenHttpTransportProperties::SetIapIdL(TUint32 aIapId)
       
   426     {
       
   427     CSenTransportProperties::SetIapIdL(aIapId);
       
   428     }
       
   429 
       
   430 void CSenHttpTransportProperties::SetSnapIdL(TUint32 aSnapId)
       
   431     {
       
   432 	CSenTransportProperties::SetSnapIdL(aSnapId);
       
   433     }
       
   434 
       
   435 
       
   436 TInt CSenHttpTransportProperties::SnapIdL(TUint32& aCurrentSnapId)
       
   437     {
       
   438     return CSenTransportProperties::SnapIdL(aCurrentSnapId);
       
   439     }
       
   440 TInt CSenHttpTransportProperties::ProxyPortL(TInt& aProxyPort)
       
   441     {
       
   442     return CSenTransportProperties::ProxyPortL(aProxyPort);
       
   443     }
       
   444 
       
   445 void CSenHttpTransportProperties::SetProxyPortL(TInt aProxyPort)
       
   446     {
       
   447     CSenTransportProperties::SetProxyPortL(aProxyPort);
       
   448     }
       
   449 
       
   450 TInt CSenHttpTransportProperties::ProxyHostL(TPtrC8& aProxyHost)
       
   451     {
       
   452     return CSenTransportProperties::ProxyHostL(aProxyHost);
       
   453     }
       
   454 
       
   455 void CSenHttpTransportProperties::SetProxyHostL(const TDesC8& aProxyHost)
       
   456     {
       
   457     CSenTransportProperties::SetProxyHostL(aProxyHost);
       
   458     }
       
   459 
       
   460 TInt CSenHttpTransportProperties::ProxyUsageL(TBool& aValue)
       
   461     {
       
   462     return CSenTransportProperties::ProxyUsageL(aValue);
       
   463     }
       
   464 
       
   465 void CSenHttpTransportProperties::SetProxyUsageL(TBool aProxyUsage)
       
   466     {
       
   467     CSenTransportProperties::SetProxyUsageL(aProxyUsage);
       
   468     }
       
   469     
       
   470 TInt CSenHttpTransportProperties::SecureDialogL(TBool& aValue)
       
   471     {
       
   472     return CSenTransportProperties::SecureDialogL(aValue);
       
   473     }
       
   474 
       
   475 void CSenHttpTransportProperties::SetSecureDialogL(TBool aSecureDialog)
       
   476     {
       
   477     CSenTransportProperties::SetSecureDialogL(aSecureDialog);
       
   478     }
       
   479 /*
       
   480 TInt CSenHttpTransportProperties::IAPDialogL(TBool& aValue)
       
   481     {
       
   482     return CSenTransportProperties::IAPDialogL(aValue);
       
   483     }
       
   484 
       
   485 void CSenHttpTransportProperties::SetIAPDialogL(TBool aIAPDialog)
       
   486     {
       
   487     CSenTransportProperties::SetIAPDialogL(aIAPDialog);
       
   488     }
       
   489 */
       
   490 TInt CSenHttpTransportProperties::DeviceIDL(TPtrC8& aDeviceID)
       
   491     {
       
   492     return CSenTransportProperties::DeviceIDL(aDeviceID);
       
   493     }
       
   494 
       
   495 void CSenHttpTransportProperties::SetDeviceIDL(const TDesC8& aDeviceID)
       
   496     {
       
   497     CSenTransportProperties::SetDeviceIDL(aDeviceID);
       
   498     }    
       
   499 TInt CSenHttpTransportProperties::DownloadFolderL(TPtrC8& aDownloadFolder)
       
   500     {
       
   501     return CSenTransportProperties::DownloadFolderL(aDownloadFolder);
       
   502     }
       
   503 
       
   504 void CSenHttpTransportProperties::SetDownloadFolderL(const TDesC8& aDownloadFolder)
       
   505     {
       
   506     CSenTransportProperties::SetDownloadFolderL(aDownloadFolder);
       
   507     }  
       
   508 
       
   509 TInt CSenHttpTransportProperties::FileAttachmentL(const TDesC8& aCid, HBufC8*& aFileName)
       
   510     {
       
   511     return CSenTransportProperties::FileAttachmentL(aCid, aFileName);
       
   512     }
       
   513 
       
   514 TInt CSenHttpTransportProperties::SetFileAttachmentL(const TDesC8& aCid, const TDesC8& aFileName)
       
   515     {
       
   516     return CSenTransportProperties::SetFileAttachmentL(aCid, aFileName);
       
   517     }
       
   518 
       
   519 void CSenHttpTransportProperties::ApplyBindingL(TSOAPVersion aSoapVersion)
       
   520     {
       
   521 
       
   522     TLSLOG_FORMAT((KSenUtilsLogChannel, KMinLogLevel, _L("CSenHttpTransportProperties::ApplyBindingL(SOAP1.%d)"), aSoapVersion==ESOAP11?1:2));
       
   523     //TLSLOG_L(KSenUtilsLogChannel, KSenUtilsLogLevel, "CSenHttpTransportProperties::ApplyBindingL");
       
   524     TPtrC8 value;
       
   525     SoapActionL(value);
       
   526     if ( aSoapVersion == ESOAP11 )
       
   527         {
       
   528         TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "- Applying SOAP 1.1 binding.");
       
   529         HBufC8* dblQutoedValue = AdaptDblQutesLC(value);
       
   530         SetSoapActionL(*dblQutoedValue);
       
   531         CleanupStack::PopAndDestroy(dblQutoedValue);
       
   532         }
       
   533     else
       
   534         {
       
   535         TLSLOG_L(KSenUtilsLogChannel, KMinLogLevel, "- Applying SOAP 1.2 binding.");
       
   536         const TInt KActionLength = 11; // comes from chars: '; action=""'
       
   537 	    CSenElement* pElement = ipFragment->AsElement().Element(KSoapActionLocalName);
       
   538 	    if ( pElement )
       
   539 		    {
       
   540 		    // Remove the type attribute, to prevent HTTP header to be added in HTTP transport plug-in(s)
       
   541 	        CSenBaseAttribute* attr = SenXmlUtils::RemoveAttributeL(*pElement, KSenTypeAttributeName);
       
   542 	        delete attr;
       
   543 	        attr = NULL;
       
   544 		    }
       
   545 //        // (Re-)setting empty (zero-length) value for type attribute should do the same trick:
       
   546 //        SetPropertyL(KSoapActionLocalName, value, KNullDesC8);
       
   547 
       
   548         HBufC8* dblQutoedValue = AdaptDblQutesLC(value);
       
   549         HBufC8* buf = HBufC8::NewLC(dblQutoedValue->Length() + KSenSoap12ContentTypeHeaderValue().Length() +
       
   550                 KActionLength);
       
   551         TPtr8 ptr = buf->Des();
       
   552         ptr.Append(KSenSoap12ContentTypeHeaderValue);
       
   553         if ( ptr.Length() )
       
   554             {
       
   555             _LIT8(KColonSpace,"; ");
       
   556             ptr.Append(KColonSpace);	//CodeScannerWarnings
       
   557             }
       
   558         _LIT8(KAction,"action=");
       
   559         ptr.Append(KAction);	//CodeScannerWarnings
       
   560         ptr.Append( *dblQutoedValue );
       
   561         SetContentTypeL( *buf );
       
   562         CleanupStack::PopAndDestroy( buf );        
       
   563         CleanupStack::PopAndDestroy( dblQutoedValue );        
       
   564         SetAcceptL( KSenSoap12AcceptHeaderValue );
       
   565         }
       
   566     }    
       
   567 HBufC8* CSenHttpTransportProperties::AdaptDblQutesLC(const TDesC8& aValue)
       
   568     {
       
   569     if((!SenXmlUtils::StartsWith(aValue, KSenDblQuot()))
       
   570        && (!SenXmlUtils::EndsWith(aValue, KSenDblQuot()))
       
   571        && (aValue.Length() >= 2 * KSenDblQuot().Length()))
       
   572         {
       
   573         HBufC8* buf = HBufC8::NewLC(aValue.Length()  + 2 * KSenDblQuot().Length());
       
   574         TPtr8 ptr = buf->Des();
       
   575         ptr.Append( KSenDblQuot);
       
   576         ptr.Append( aValue );
       
   577         ptr.Append( KSenDblQuot);
       
   578         return buf;
       
   579         }
       
   580      else
       
   581         {
       
   582         return aValue.AllocLC();
       
   583         }
       
   584     }
       
   585 MSenProperties* CSenHttpTransportProperties::CloneL() const
       
   586     {
       
   587     CSenElement& element = ipFragment->AsElement();
       
   588     
       
   589     CSenHttpTransportProperties* pProperties = this->NewLC(element);
       
   590     CleanupStack::Pop(pProperties);
       
   591     return pProperties;
       
   592     }
       
   593 
       
   594 TInt CSenHttpTransportProperties::MwsNamespaceL(TPtrC8& aMwsNamespace)
       
   595     {
       
   596     return CSenTransportProperties::MwsNamespaceL(aMwsNamespace);
       
   597     }
       
   598 
       
   599 void CSenHttpTransportProperties::SetMwsNamespaceL(const TDesC8& aMwsNamespace)
       
   600     {
       
   601     CSenTransportProperties::SetMwsNamespaceL(aMwsNamespace);
       
   602     }  
       
   603 
       
   604 // END OF FILE
       
   605 
       
   606