epoc32/include/mw/senxmlservicedescription.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@4
     2
* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@4
    14
* Description:           Class implements the most common value object used in WSF, 
williamr@2
    15
*                which is used to  describe some invocable service. 
williamr@2
    16
*
williamr@2
    17
*/
williamr@2
    18
williamr@2
    19
williamr@2
    20
williamr@2
    21
williamr@2
    22
williamr@2
    23
williamr@2
    24
williamr@2
    25
williamr@4
    26
williamr@4
    27
williamr@4
    28
williamr@2
    29
#ifndef SEN_XML_SERVICE_DESCRIPTION_H
williamr@2
    30
#define SEN_XML_SERVICE_DESCRIPTION_H
williamr@2
    31
williamr@2
    32
//  INCLUDES
williamr@2
    33
#include <e32base.h>
williamr@2
    34
#include <e32des8.h>
williamr@2
    35
#include <e32std.h>
williamr@2
    36
#include <MSenServiceDescription.h>
williamr@2
    37
#include <MSenProviderPolicy.h>
williamr@2
    38
#include <SenDomFragment.h>
williamr@2
    39
williamr@2
    40
// CONSTANTS
williamr@2
    41
const TInt KStateParsingCredentials         = 12;
williamr@2
    42
const TInt KStateParsingSingleCredential    = 122;
williamr@2
    43
const TInt KStateParsingProviderPolicy      = 1222;
williamr@2
    44
const TInt KStateParsingServicePolicy       = 12222;
williamr@2
    45
williamr@2
    46
_LIT8( KSenAttrSoap12,                  "SOAP12"               );
williamr@2
    47
_LIT8( KSenAttrAddressing,              "Addressing"           );
williamr@2
    48
_LIT8( KSenAttrClientEntropy,           "ClientEntropy"        );
williamr@2
    49
_LIT8( KSenAttrTokenType,               "TokenType"            );
williamr@2
    50
_LIT8( KSenAttrPassportExtensions,      "PassportExtensions"   );
williamr@2
    51
_LIT8( KSenAttrMetadataEndpoint,        "MetadataEndpoint"     );
williamr@2
    52
_LIT8( KSenAttrUsernameTokenOverTLS,    "UsernameTokenOverTLS" );
williamr@2
    53
_LIT8( KSenAttrPromptUserInfo,          "promptUserInfo"       );
williamr@2
    54
williamr@4
    55
_LIT8( KSenLocalnameAppInfo,            "AppInfo"               );
williamr@4
    56
_LIT8( KSenLocalnameWAPGW,              "WAPGW"                 );
williamr@4
    57
_LIT8( KSenLocalnameMwsNamespace,       "MwsNamespace"          );
williamr@2
    58
// FORWARD DECLARATIONS
williamr@2
    59
class CSenCredential;
williamr@2
    60
class CSenProviderPolicy;
williamr@2
    61
class CSenServicePolicy;
williamr@2
    62
class MSenServicePolicy;
williamr@2
    63
williamr@2
    64
// DATA TYPES
williamr@2
    65
typedef RPointerArray<CSenCredential> RCredentialList;
williamr@2
    66
williamr@2
    67
// CLASS DECLARATION
williamr@2
    68
williamr@2
    69
/**
williamr@2
    70
* CSenXmlServiceDescription class implements the most
williamr@2
    71
* common value object used in WSF, which is used to 
williamr@2
    72
* describe some invocable service. 
williamr@2
    73
*
williamr@2
    74
* Class offers basic properties which describe some
williamr@2
    75
* service and methods to manipulate this info. These
williamr@2
    76
* properties are stored in XML fragment format and 
williamr@2
    77
* a class instance can be represented as one XML tree.
williamr@2
    78
*
williamr@2
    79
* The main properties for service description are:
williamr@2
    80
*    - contract (typically some URI)
williamr@2
    81
*    - endpoint (typically some URL)
williamr@2
    82
*    - frameworkID
williamr@2
    83
*
williamr@2
    84
*  @lib SenServDesc.lib
williamr@2
    85
*  @since Series60 3.0
williamr@2
    86
*/
williamr@2
    87
class CSenXmlServiceDescription : public CSenDomFragment,
williamr@2
    88
                                  public MSenServiceDescription,
williamr@2
    89
                                  public MSenProviderPolicy
williamr@2
    90
    {
williamr@2
    91
    public:  // Constructors and destructor
williamr@2
    92
        
williamr@2
    93
        /**
williamr@2
    94
        * Standard 2 phase constructor
williamr@2
    95
        * @return a pointer to a new CSenXmlServiceDescription instance.
williamr@2
    96
        */
williamr@2
    97
        IMPORT_C static CSenXmlServiceDescription* NewL();
williamr@2
    98
williamr@2
    99
        /**
williamr@2
   100
        * Standard 2 phase constructor
williamr@2
   101
        * @return a pointer to a new CSenXmlServiceDescription instance,
williamr@2
   102
        *        which is left on cleanup stack.
williamr@2
   103
        */
williamr@2
   104
        IMPORT_C static CSenXmlServiceDescription* NewLC();
williamr@2
   105
williamr@2
   106
        /**
williamr@2
   107
        * Standard 2 phase constructor
williamr@2
   108
        * @param aNamespaceURI namespace URI for the service description.
williamr@2
   109
        * @return a pointer to a new CSenXmlServiceDescription instance
williamr@2
   110
        */
williamr@2
   111
        IMPORT_C static CSenXmlServiceDescription* NewL(const TDesC8& aNamespaceURI);
williamr@2
   112
williamr@2
   113
        /**
williamr@2
   114
        * Standard 2 phase constructor
williamr@2
   115
        * @param aNamespaceURI namespace URI for the service description.
williamr@2
   116
        * @return a pointer to a new CSenXmlServiceDescription instance,
williamr@2
   117
        *        which is left on cleanup stack.
williamr@2
   118
        */
williamr@2
   119
        IMPORT_C static CSenXmlServiceDescription* NewLC(const TDesC8& aNamespaceURI);
williamr@2
   120
williamr@2
   121
        /**
williamr@2
   122
        * Standard 2 phase constructors
williamr@2
   123
        * @param aEndpoint the service endpoint. Note that endpoint cannot 
williamr@2
   124
        *        include characters which are illegal in XML. If endpoint
williamr@2
   125
        *        is an URL which contains illegal characters (like '&'-char),
williamr@2
   126
        *        those need to be encoded into XML entity form (like &amp;).
williamr@2
   127
        *        EncodeHttpCharactersLC() method from XmlUtils can be used
williamr@2
   128
        *        for encoding of basic XML entities.
williamr@2
   129
        * @param aContract identifies the service type. 
williamr@2
   130
        * @return a pointer to a new CSenXmlServiceDescription instance
williamr@2
   131
        */
williamr@2
   132
        IMPORT_C static CSenXmlServiceDescription* NewL(const TDesC8& aEndPoint,
williamr@2
   133
                                                        const TDesC8& aContract);
williamr@2
   134
williamr@2
   135
        /**
williamr@2
   136
        * Standard 2 phase constructors
williamr@2
   137
        * @param aEndpoint the service endpoint. Note that endpoint cannot 
williamr@2
   138
        *        include characters which are illegal in XML. If endpoint
williamr@2
   139
        *        is an URL which contains illegal characters (like '&'-char),
williamr@2
   140
        *        those need to be encoded into XML entity form (like &amp;).
williamr@2
   141
        *        EncodeHttpCharactersLC() method from XmlUtils can be used
williamr@2
   142
        *        for encoding of basic XML entities.
williamr@2
   143
        * @param aContract identifies the service type. 
williamr@2
   144
        * @return a pointer to a new CSenXmlServiceDescription instance,
williamr@2
   145
        *        which is left on cleanup stack.
williamr@2
   146
        */
williamr@2
   147
        IMPORT_C static CSenXmlServiceDescription* NewLC(const TDesC8& aEndPoint,
williamr@2
   148
                                                         const TDesC8& aContract);
williamr@2
   149
        
williamr@2
   150
        /**
williamr@2
   151
        * Destructor.
williamr@2
   152
        */
williamr@2
   153
        IMPORT_C virtual ~CSenXmlServiceDescription();
williamr@2
   154
williamr@2
   155
        // New functions
williamr@2
   156
williamr@2
   157
        /**
williamr@2
   158
        * Setter for the framework ID.
williamr@2
   159
        * The developer may use a FrameworkID to search for a session of    
williamr@2
   160
        * (i.e. connection to) a certain service invocation framework.
williamr@2
   161
        * @since Series60 3.0
williamr@2
   162
        * @param aFrameworkId
williamr@2
   163
        * If set to KNullDesC8, then any matching framework may be used.
williamr@2
   164
        * The default frameworkID in WSF is "ID-WSF" 
williamr@2
   165
        * (KDefaultIdWsfFrameworkID).
williamr@2
   166
        * Note that Basic Web Services MUST use "WS-I" 
williamr@2
   167
        * (KDefaultBasicWebServicesFrameworkID).
williamr@2
   168
        */
williamr@2
   169
        IMPORT_C void SetFrameworkIdL(const TDesC8& aFrameworkID);
williamr@2
   170
williamr@2
   171
        /**
williamr@2
   172
        * Method returns the localname for this service description.
williamr@2
   173
        * This is the localname of the element, when this class is
williamr@2
   174
        * represented as an XML element.
williamr@2
   175
        * @since Series60 3.0
williamr@2
   176
        * @return descriptor to XML localname of this service description
williamr@2
   177
        */
williamr@2
   178
        IMPORT_C virtual const TDesC8& NewElementName();
williamr@2
   179
        
williamr@2
   180
        /**
williamr@2
   181
        * Returns list of credentials. Ownership is not transferred, any
williamr@2
   182
        * modifications to the contents of the list modify the real objects.
williamr@2
   183
        * @since Series60 3.0
williamr@2
   184
        * @return the list of credentials (CSenCredential objects).
williamr@2
   185
        */
williamr@2
   186
        IMPORT_C  RCredentialList& Credentials();        
williamr@2
   187
williamr@2
   188
        // Functions from base classes
williamr@2
   189
    
williamr@2
   190
        // From MSenProviderPolicy
williamr@2
   191
        IMPORT_C virtual void SetIapIdL(TUint32 aIapId);
williamr@2
   192
        IMPORT_C virtual TInt IapId(TUint32& aCurrentIapId);
williamr@2
   193
        IMPORT_C virtual void SetIdentityProviderIdsL(
williamr@2
   194
                                        CSenIdentityProviderIdArray8& aList);
williamr@2
   195
		IMPORT_C TInt SetTransportPropertiesL(const TDesC8& aProperties);
williamr@2
   196
williamr@2
   197
        IMPORT_C virtual TInt AddIdentityProviderIdL(TDesC8& aProviderId);
williamr@2
   198
        IMPORT_C virtual TInt RebuildFrom(MSenProviderPolicy& aTemplate);
williamr@2
   199
        IMPORT_C virtual const CSenIdentityProviderIdArray8&
williamr@2
   200
                                                    IdentityProviderIds8L();
williamr@2
   201
	    IMPORT_C TInt TransportPropertiesL(HBufC8*& aProperties);
williamr@2
   202
        
williamr@2
   203
        IMPORT_C virtual TBool Accepts(MSenProviderPolicy& aPolicyPattern);
williamr@2
   204
        
williamr@2
   205
        // From MSenServiceDescription:
williamr@2
   206
        IMPORT_C TDescriptionClassType DescriptionClassType();
williamr@2
   207
        IMPORT_C TBool Matches(MSenServiceDescription& aPattern);
williamr@2
   208
        IMPORT_C TPtrC8 Contract();
williamr@2
   209
williamr@2
   210
        // New method
williamr@2
   211
         /**
williamr@2
   212
        * Method for checking if service description has a certain facet.
williamr@2
   213
        * @since Series60 3.0
williamr@2
   214
        * @param aURI       the facet to check, typically some URI.
williamr@2
   215
        * @param aHasFacet  is ETrue if facet is found and EFalse, if not.
williamr@2
   216
        * @return       KErrNone or other system-wide Symbian error codes.
williamr@2
   217
        */
williamr@2
   218
        IMPORT_C virtual TInt HasFacetL(const TDesC8& aURI, TBool& aHasFacet);
williamr@2
   219
        
williamr@2
   220
        // From MSenServiceDescription
williamr@2
   221
        IMPORT_C virtual TInt FacetValue(TDesC8& aURI, HBufC8*& aValueTo);
williamr@2
   222
        IMPORT_C virtual TInt AddFacetL(const CSenFacet& aFacet);
williamr@2
   223
        IMPORT_C virtual TInt SetFacetL(const CSenFacet& aFacet);
williamr@2
   224
        IMPORT_C virtual TInt RemoveFacet(const TDesC8& aURI);
williamr@2
   225
        IMPORT_C virtual TInt FacetsL(RFacetArray& aFacetArray);
williamr@2
   226
        
williamr@2
   227
        // New method
williamr@2
   228
        /**
williamr@2
   229
        * On success, this method returns a positive integer if this 
williamr@2
   230
        * service description matches with the given pattern in at 
williamr@2
   231
        * least one aspect. Higher numbers mean a closer match.
williamr@2
   232
        *
williamr@2
   233
        * The bits of information that are in the pattern are read and compared
williamr@2
   234
        * to corresponding fields in this ServiceDescription. Note that a pattern
williamr@2
   235
        * may have far fewer fields and that only the non-null fields are compared.
williamr@2
   236
        * For example, assume that a pattern with only a contract was defined;
williamr@2
   237
        * with the contract set to "urn:example.com:service". 
williamr@2
   238
        * Each ServiceDescription with the same contract will match the pattern,
williamr@2
   239
        * even if such a ServiceDescription has non-null fields for other aspects.
williamr@2
   240
        * @since Series60 3.0
williamr@2
   241
        * @param    aPattern a ServiceDescription, typically with partial
williamr@2
   242
        *           information.
williamr@2
   243
        * @return the score or error. If nothing matches, returns 0. In case of 
williamr@2
   244
        *  any error, a negative value is returned. 
williamr@2
   245
        */
williamr@2
   246
        IMPORT_C virtual TInt ScoreMatchL(MSenServiceDescription& aPattern);
williamr@2
   247
williamr@2
   248
        // From MSenServiceDescription
williamr@2
   249
williamr@2
   250
        IMPORT_C TPtrC8 Endpoint();
williamr@2
   251
        IMPORT_C TPtrC8 FrameworkId();
williamr@2
   252
        IMPORT_C TPtrC8 FrameworkVersion();
williamr@2
   253
        IMPORT_C void SetContractL(const TDesC8& aContract);
williamr@2
   254
        IMPORT_C void SetEndPointL(const TDesC8& aEndPoint);
williamr@2
   255
        
williamr@2
   256
        // From CSenBaseFragment 
williamr@2
   257
        
williamr@2
   258
        /** 
williamr@2
   259
        * Gets the service description as XML fragment in UTF-8 format.
williamr@2
   260
        * @since Series60 3.0
williamr@2
   261
        * @return the service description as XML, which ownership is
williamr@2
   262
        *         transferred to the caller.
williamr@2
   263
        */
williamr@2
   264
        IMPORT_C virtual HBufC8* AsXmlL();
williamr@2
   265
williamr@2
   266
        /**
williamr@2
   267
        * Gets the service description as XML, in Unicode (UCS-2)
williamr@2
   268
        * @since Series60 3.0
williamr@2
   269
        * @return the service description as XML, in Unicode (UCS-2)
williamr@2
   270
        *         encoding form.
williamr@2
   271
        */
williamr@2
   272
        IMPORT_C virtual HBufC* AsXmlUnicodeL();
williamr@2
   273
williamr@2
   274
        /**
williamr@2
   275
        * Writes this service description as XML, in UTF-8 form to a stream
williamr@2
   276
        * @since Series60 3.0
williamr@2
   277
        * @param aWriteStream   to write into.
williamr@2
   278
        */
williamr@2
   279
        IMPORT_C virtual void WriteAsXMLToL(RWriteStream& aWriteStream);
williamr@2
   280
williamr@2
   281
williamr@2
   282
        // From CSenDomFragment 
williamr@2
   283
        
williamr@2
   284
        /**
williamr@2
   285
        * Method looks for FrameworkID attribute from the given XML attribute
williamr@2
   286
        * array and if one is found, sets its value for this instance. In
williamr@2
   287
        * addition, all the namespace attributes are copied. All other
williamr@2
   288
        * attributes are discarded.
williamr@2
   289
        * @since Series60 3.0
williamr@2
   290
        * @param aAttributes    the attribute list.
williamr@2
   291
        */
williamr@2
   292
        IMPORT_C void SetAttributesL(const RAttributeArray& aAttributes);
williamr@2
   293
williamr@2
   294
        /**
williamr@2
   295
        * Resumes the parsing. Called by the delegate fragment 
williamr@2
   296
        * in order to notify owner, which needs to regain 
williamr@2
   297
        * (take over) parsing. For example, when a policy fragment
williamr@2
   298
        * is parsed, the service description fragment should
williamr@2
   299
        * resume parsing the rest of its own XML document 
williamr@2
   300
        * representation.
williamr@2
   301
        * @since Series60 3.0
williamr@2
   302
        * @param aNsUri     The namespace URI of the current element
williamr@2
   303
        * @param aLocalName The local name of the current element
williamr@2
   304
        * @param aQName     The qualified name of the current element
williamr@2
   305
        */
williamr@2
   306
        IMPORT_C void ResumeParsingFromL(const TDesC8& aNsUri,
williamr@2
   307
                                         const TDesC8& aLocalName,
williamr@2
   308
                                         const TDesC8& aQName);
williamr@2
   309
                
williamr@2
   310
    protected:  // New functions
williamr@2
   311
        
williamr@2
   312
        /**
williamr@2
   313
        * C++ default constructor.
williamr@2
   314
        * @param aType enumeration defining the type of this class.
williamr@2
   315
        */
williamr@2
   316
        IMPORT_C CSenXmlServiceDescription(TDescriptionClassType aType);
williamr@2
   317
        
williamr@2
   318
        /**
williamr@2
   319
         * Basic ConstructL function.
williamr@2
   320
         */
williamr@2
   321
        IMPORT_C void ConstructL();
williamr@2
   322
williamr@2
   323
        /**
williamr@2
   324
        * Basic ConstructL function.
williamr@2
   325
        * @since Series60 3.0
williamr@2
   326
        * @param aNamespaceURI for this service description, which is
williamr@2
   327
        *        also an XML element.
williamr@2
   328
        */
williamr@2
   329
        IMPORT_C void ConstructL(const TDesC8& aNamespaceURI);
williamr@2
   330
williamr@2
   331
        /**
williamr@2
   332
        * Basic ConstructL function.
williamr@2
   333
        * @since Series60 3.0
williamr@2
   334
        * @param aEndpoint the service endpoint. Note that endpoint cannot 
williamr@2
   335
        *        include characters which are illegal in XML. If endpoint
williamr@2
   336
        *        is an URL which contains illegal characters (like '&'-char),
williamr@2
   337
        *        those need to be encoded into XML entity form (like &amp;).
williamr@2
   338
        *        EncodeHttpCharactersLC() method from XmlUtils can be used
williamr@2
   339
        *        for encoding of basic XML entities.
williamr@2
   340
        * @param aContract identifies the service type, typically some URN.
williamr@2
   341
        */
williamr@2
   342
        IMPORT_C void ConstructL(const TDesC8& aEndPoint, const TDesC8& aContract);
williamr@2
   343
williamr@2
   344
        // Functions from base classes
williamr@2
   345
        
williamr@2
   346
        // From CSenDomFragment 
williamr@2
   347
        
williamr@2
   348
        /**
williamr@2
   349
        * Callback function which implements the XML content handler interface.
williamr@2
   350
        * @since Series60 3.0
williamr@2
   351
        * @param aNsURI     The namespace URI of the new element
williamr@2
   352
        * @param aLocalName The local name of the new element
williamr@2
   353
        * @param aQName     The qualified name of the new element
williamr@2
   354
        * @param aAttributes    The attributes of the new element
williamr@2
   355
        */
williamr@2
   356
        IMPORT_C virtual void StartElementL(const TDesC8& aNsUri,
williamr@2
   357
                                            const TDesC8& aLocalName,
williamr@2
   358
                                            const TDesC8& aQName,
williamr@2
   359
                                            const RAttributeArray& aAttributes);
williamr@2
   360
williamr@2
   361
        // From CSenBaseFragment 
williamr@2
   362
        /**
williamr@2
   363
        * Callback function which implement the XML content handler interface.
williamr@2
   364
        * @since Series60 3.0
williamr@2
   365
        * @param aNsUri     The namespace URI of the new element
williamr@2
   366
        * @param aLocalName The local name of the new element
williamr@2
   367
        * @param aQName     The qualified name of the new element
williamr@2
   368
        */
williamr@2
   369
        IMPORT_C virtual void EndElementL(const TDesC8& aNsUri,
williamr@2
   370
                                          const TDesC8& aLocalName,
williamr@2
   371
                                      const TDesC8& aQName);
williamr@2
   372
                                          
williamr@2
   373
    public:
williamr@2
   374
        /**
williamr@2
   375
        * Method returns ETrue if the primary keys of this service description
williamr@2
   376
        * are equal. Definition of primary keys varies on concrete implementations.
williamr@2
   377
        *
williamr@2
   378
        * In a typical XML sub class implementation the primary keys are Contract 
williamr@2
   379
        * and Endpoint elements. 
williamr@2
   380
        *
williamr@2
   381
        * Difference to Match() method is that primary keys - often descriptors - 
williamr@2
   382
        * MUST be equal both in this service description and in aCandidate, unlike
williamr@2
   383
        * in Match(), where argument is more like wildcard pattern matching even
williamr@2
   384
        * in cases where it includes fewer fields (less information).
williamr@2
   385
        *
williamr@2
   386
        * @since Series60
williamr@2
   387
        * @param    aCandidate is a service description, which primary keys are
williamr@2
   388
        *           checked in this comparison.
williamr@2
   389
        *
williamr@2
   390
        * @return TBool ETrue if primary keys are equal, EFalse otherwise. 
williamr@2
   391
        */
williamr@2
   392
        IMPORT_C TBool HasEqualPrimaryKeysL(MSenServiceDescription& aCandidate);
williamr@2
   393
williamr@2
   394
        /*
williamr@2
   395
        * Method checks specific pieces of information to determine, whether this
williamr@2
   396
        * service description is local or not. Typically this is defined by the
williamr@2
   397
        * endpoint's scheme, which is KSenTransportSchemeLocal in most of the cases,
williamr@2
   398
        * when this method returns true.
williamr@2
   399
        * @return boolean indicating whether this endpoint is local or not.
williamr@2
   400
        */
williamr@2
   401
        IMPORT_C TBool IsLocalL(); 
williamr@2
   402
williamr@2
   403
williamr@2
   404
        /*
williamr@2
   405
        * Method for binding transport plug-in type with the endpoint in question.
williamr@2
   406
        * Function adds/sets XML attribute called "cue" for <Endpoint> element:
williamr@2
   407
        *  
williamr@2
   408
        *  <ServiceDescription>
williamr@2
   409
        *    <Endpoint cue="com.nokia.wsf.transport.plugin.hostlet">
williamr@2
   410
        *        local://urn:nokia.com.test.hostlet
williamr@2
   411
        *    </Endpoint>
williamr@2
   412
        *  </ServiceDescription>
williamr@2
   413
        *
williamr@2
   414
        * In above example, eventhough endpoint scheme "local://" would normally
williamr@2
   415
        * invoke different type of plug-in (ECOM hostlet), the "cue" attribute 
williamr@2
   416
        * overrides this, and forces hostlet connection transport plug-in to be
williamr@2
   417
        * loaded.
williamr@2
   418
        *
williamr@2
   419
        * Transport plug-in types (cues):
williamr@2
   420
        *
williamr@2
   421
        *    _LIT8(KSenTransportCueHTTP,              "com.nokia.wsf.transport.plugin.httpchannel");
williamr@2
   422
        *    _LIT8(KSenTransportCueVirtualTCP,        "com.nokia.wsf.transport.plugin.virtualtcp");
williamr@2
   423
        *    _LIT8(KSenTransportCueLocalEcom,         "com.nokia.wsf.transport.plugin.local");  
williamr@2
   424
        *    _LIT8(KSenTransportCueHostletConnection, "com.nokia.wsf.transport.plugin.hostlet");
williamr@2
   425
        *
williamr@2
   426
        *
williamr@2
   427
        * Note that this method does not attempt to load the plug-in - it might not
williamr@2
   428
        * even exist in the system. Neither is this attribute checked when XML service
williamr@2
   429
        * description is parsed. As a conclusion, if non-existant plug-ins are bind 
williamr@2
   430
        * to endpoints, they will be ignored, and the transport is created in normal
williamr@2
   431
        * way and plug-in is chosen based on endpoint scheme and/or defaults.
williamr@2
   432
        * 
williamr@2
   433
        * @param aTransportCue is the ECOM cue of CSenTransport implementation.
williamr@2
   434
        * In ECOM resource files, cue is the value of "default_data" property.
williamr@2
   435
        * @return KErrNone on success
williamr@2
   436
        *         KErrSenNoEndpoint, if  endpoint element does not exist in this XML
williamr@2
   437
        *         service description.
williamr@2
   438
        */
williamr@2
   439
        IMPORT_C TInt SetTransportCueL(const TDesC8& aTransportCue);
williamr@2
   440
williamr@2
   441
williamr@2
   442
        /**
williamr@2
   443
        * Getter for transport cue, assuming that attribute has been set,
williamr@2
   444
        * and that has "cue" -attribute.
williamr@2
   445
        * @return transport plug-in ECOM cue, or KNullDesC8, if it has
williamr@2
   446
        * not been set in this service description. In each ECOM resource
williamr@2
   447
        * file the cue is defined by "default_data" property.
williamr@2
   448
        */
williamr@2
   449
        IMPORT_C TPtrC8 TransportCue();
williamr@2
   450
williamr@2
   451
        /**
williamr@2
   452
        * Getter for (web) service policy
williamr@2
   453
        * @return pointer to service policy, or NULL, if it is not available
williamr@2
   454
        */
williamr@2
   455
        IMPORT_C MSenServicePolicy* ServicePolicy();
williamr@2
   456
williamr@2
   457
        /**
williamr@2
   458
        * Method provides convenient way to add a new value in Client Policy
williamr@2
   459
        * This method will add elements such as <SOAP12> or <UsernameTokenOverTLS>
williamr@2
   460
        * in the Policy to be used by stack. Infact this method adds a new element 
williamr@2
   461
        * in xml representation of ServicePolicy.
williamr@2
   462
        * @param aName is the Name of the attribute.
williamr@2
   463
        * @return KErrNone on success, KErrArgument if any of the arguments 
williamr@2
   464
        * (descriptors) is of zero-length, or one of the system-wide 
williamr@2
   465
        * error codes otherwise.
williamr@2
   466
        */
williamr@2
   467
        IMPORT_C TInt SetPolicyL(const TDesC8& aName);
williamr@2
   468
williamr@2
   469
        /**
williamr@2
   470
        * Method provides convenient way to add a new value in Client Policy
williamr@2
   471
        * This method will add elements such as <Addressing>
williamr@2
   472
        * in the Policy to be used by stack. Infact this method adds a new element 
williamr@2
   473
        * in xml representation of ServicePolicy and adds its value as contents of the element.
williamr@2
   474
        * <Addressing>http://schemas.xmlsoap.org/ws/2004/03/addressing</Addressing>
williamr@2
   475
        * @param aName is the Name of the Policy attribute.
williamr@2
   476
        * @param aValue is the Contents of the Policy attribute.
williamr@2
   477
        * @return KErrNone on success, KErrArgument if any of the arguments 
williamr@2
   478
        * (descriptors) is of zero-length, or one of the system-wide 
williamr@2
   479
        * error codes otherwise.
williamr@2
   480
        */
williamr@2
   481
        IMPORT_C TInt SetPolicyL(const TDesC8& aName, const TDesC8& aValue);
williamr@2
   482
williamr@2
   483
        /**
williamr@2
   484
        * Method provides convenient way to add a new value in Client Policy
williamr@2
   485
        * This method will add elements such as <Addressing>
williamr@2
   486
        * in the Policy to be used by stack, plus it will add one specified
williamr@2
   487
        * attribute (name and value) for that element. Infact this method adds
williamr@2
   488
        * a new element - and it's attribute - in the xml representation of 
williamr@2
   489
        * ServicePolicy element, which is direct child to ServiceDescription
williamr@2
   490
        * (root element) document.
williamr@2
   491
        * <MetadataEndpoint method = "GET">http://www.mypolicyendpoint.com/policy2/</MetadataEndpoint>
williamr@2
   492
        * @param aName is the Name of the Policy attribute.
williamr@2
   493
        * @param aValue is the Contents of the Policy attribute.
williamr@2
   494
        * @param aAttribName is the Name of the attribute in element aName
williamr@2
   495
        * @param aAttribValue is the Contents of the aAttribName attribute.
williamr@2
   496
        * @return KErrNone on success, KErrArgument if any of the arguments 
williamr@2
   497
        * (descriptors) is of zero-length, or one of the system-wide 
williamr@2
   498
        * error codes otherwise.
williamr@2
   499
        */
williamr@2
   500
        IMPORT_C TInt SetPolicyL(const TDesC8& aName, const TDesC8& aValue, const TDesC8& aAttribName, const TDesC8& aAttribValue);
williamr@2
   501
williamr@2
   502
        /**
williamr@2
   503
        * Setter for (identity) provider ID
williamr@2
   504
        * @since Series60 5.0
williamr@2
   505
        * @param aProviderID the unique identifier of the (identity) provider
williamr@2
   506
        * @return KErrNone on success, KErrArgument if aProviderID is of zero-length,
williamr@2
   507
        * or one of the system-wide Symbian error codes otherwise.
williamr@2
   508
        */
williamr@2
   509
        IMPORT_C TInt SetProviderIdL( const TDesC8& aProviderID );
williamr@2
   510
        
williamr@2
   511
        /**
williamr@2
   512
        * Getter for (identity) provider ID
williamr@2
   513
        * @since Series60 5.0
williamr@2
   514
        * @return the (locally) unique identifier of the (identity) provider
williamr@2
   515
        * @return KErrNone on success, KErrArgument if aProviderID is of zero-length,
williamr@2
   516
        * or one of the system-wide Symbian error codes otherwise.
williamr@2
   517
        */
williamr@2
   518
        IMPORT_C TPtrC8 ProviderId();
williamr@2
   519
williamr@2
   520
        /**
williamr@2
   521
        * Setter for userinfo (KSenAttrPromptUserInfo) attribute, which 
williamr@2
   522
        * - password notifier dialog is shown to end-user or not, when 
williamr@2
   523
        * authentication fails (due wrong, or incomplete userinfo).
williamr@2
   524
        * @param aPromptUserInfoMode 
williamr@2
   525
        *  EFalse dictates that an error must be returned when creating
williamr@2
   526
        *         a service connection and userinfo is not accepted by 
williamr@2
   527
        *         (remote) authentication, instead of showing the dialog.
williamr@2
   528
        *  ETrue (or if attribute does not exist in this XML SD) means that
williamr@2
   529
        *         end-user should be prompted (default behaviour). The number
williamr@2
   530
        *         of retry attempts (each showing a dialog) is service invocation
williamr@2
   531
        *         framework spesific; typically 3 retries are permitted.     
williamr@2
   532
        */
williamr@2
   533
        IMPORT_C void CSenXmlServiceDescription::SetPromptUserInfoL( TBool aPromptUserInfoMode );
williamr@2
   534
williamr@2
   535
        /**
williamr@2
   536
        * Getter for current userinfo mode (KSenAttrPromptUserInfo attribute).
williamr@2
   537
        * @return Boolean that indicates the mode:
williamr@2
   538
        *  EFalse means that end-user prompts (notifier dialogs) have been 
williamr@2
   539
        *  explicitely surpressed, and thus will not be shown to end-user:
williamr@2
   540
        *  attribute value is exactly as follows: "false"
williamr@2
   541
        *  ETrue means that attribute named as KSenAttrPromptUserInfo 
williamr@2
   542
        *  does not exist (default), or it has ANY value OTHER than "false"
williamr@2
   543
        */
williamr@2
   544
        IMPORT_C TBool PromptUserInfo();
williamr@2
   545
williamr@2
   546
	public:
williamr@2
   547
		/**
williamr@2
   548
        * Sets the SNAP ID.
williamr@2
   549
        * @param aIapId  A TUint32 Snap ID
williamr@2
   550
        */
williamr@2
   551
        IMPORT_C void SetSnapIdL(TUint32 aIapId); 
williamr@2
   552
		/**
williamr@2
   553
        * Gets the SNAP ID.
williamr@2
   554
        * @param aCurrentSnapId  A TUint32 reference to be filled in with the
williamr@2
   555
        *                       value of the SNAP ID.
williamr@2
   556
        * @return               KErrNone if no error, or some of the system
williamr@2
   557
        *                       wide error codes.
williamr@2
   558
        */
williamr@2
   559
        IMPORT_C TInt SnapId(TUint32& aCurrentIapId); 
williamr@2
   560
		
williamr@2
   561
    private:
williamr@2
   562
        TInt FacetValueL(TDesC8& aURI, HBufC8*& aValueTo);
williamr@2
   563
        TInt RemoveFacetL(const TDesC8& aURI);
williamr@2
   564
williamr@2
   565
    protected: // Data
williamr@2
   566
        // the type of this class instance
williamr@2
   567
        const TDescriptionClassType iType;
williamr@2
   568
williamr@2
   569
    private: // Data
williamr@2
   570
        CSenServicePolicy* iServicePolicy;
williamr@2
   571
        CSenCredential* iCredential;
williamr@2
   572
        RCredentialList iCredentialList;
williamr@2
   573
williamr@2
   574
        // Timestamp indicating validity of credentials. Using SenDateUtils 
williamr@2
   575
        // FromXmlDateTimeL and ToXmlDateTimeUtf8L is recommended for conversions.
williamr@2
   576
        TTime iNotOnOrAfter;
williamr@2
   577
        CSenProviderPolicy* iProviderPolicy;
williamr@2
   578
    };
williamr@2
   579
williamr@2
   580
#endif // SEN_XML_SERVICE_DESCRIPTION_H
williamr@2
   581
williamr@2
   582
// End of File
williamr@2
   583
williamr@2
   584