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